View Issue Details

IDProjectCategoryView StatusLast Update
0006557The Dark ModCodingpublic15.07.2024 07:42
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.12 
Target VersionTDM 2.13Fixed in VersionTDM 2.13 
Summary0006557: Model not lit due to portal flow culling
DescriptionDragofer sent a test map where candle does not light a ship from some positions.
TagsNo tags attached.

Activities

stgatilov

stgatilov

14.07.2024 22:03

administrator   ~0016792

Here is the video showing the problem: https://drive.google.com/file/d/1Al0fyuYutYJGRLcRsW4szCJfg0JiW3wj/view
If you take the candle and move it near the left end of the boat, sometimes light toggles off (it should not).
test_6557_longship.7z (534,425 bytes)
stgatilov

stgatilov

14.07.2024 22:07

administrator   ~0016793

For portal flow culling in idRenderWorldLocal::CullInteractionByLightFlow, I use idBox::PlaneSide method.

Note that idBox is ORIENTED bounding box, i.e. is stores 3x3 matrix for local coordinate system.
Here is how the method is implemented (it has been like this since the very beginning):

int idBox::PlaneSide( const idPlane &plane, const float epsilon ) const {
    float d1, d2;

    d1 = plane.Distance( center );
    d2 = idMath::Fabs( extents[0] * plane.Normal()[0] ) +
            idMath::Fabs( extents[1] * plane.Normal()[1] ) +
                idMath::Fabs( extents[2] * plane.Normal()[2] );

    if ( d1 - d2 > epsilon ) {
        return PLANESIDE_FRONT;
    }
    if ( d1 + d2 < -epsilon ) {
        return PLANESIDE_BACK;
    }
    return PLANESIDE_CROSS;
}

As you might notice, "axis" member is not used, so local coordinate system is ignored here, that's why portal flow culling ignores it completely.

I think this bug happens under two conditions:
  1) entity's rotation is not identity
  2) model is stretched in 1/2 dimensions, i.e. does not look like a box/sphere
stgatilov

stgatilov

15.07.2024 07:42

administrator   ~0016794

Fixed in r10826.

Issue History

Date Modified Username Field Change
14.07.2024 22:00 stgatilov New Issue
14.07.2024 22:00 stgatilov Status new => assigned
14.07.2024 22:00 stgatilov Assigned To => stgatilov
14.07.2024 22:03 stgatilov Note Added: 0016792
14.07.2024 22:03 stgatilov File Added: test_6557_longship.7z
14.07.2024 22:07 stgatilov Note Added: 0016793
15.07.2024 07:42 stgatilov Note Added: 0016794
15.07.2024 07:42 stgatilov Status assigned => resolved
15.07.2024 07:42 stgatilov Resolution open => fixed
15.07.2024 07:42 stgatilov Fixed in Version => TDM 2.13