View Issue Details

IDProjectCategoryView StatusLast Update
0005529The Dark ModTexturespublic04.03.2021 23:15
ReporterDragofer Assigned To 
PrioritynormalSeveritynormalReproducibilityalways
Status newResolutionopen 
Product VersionTDM 2.08 
Target VersionTDM 2.10 
Summary0005529: Projected lights can't use appropriate falloff images
DescriptionIt does not appear to be possible to assign gradient falloff images to projected lights in TDM without major rendering bugs, mainly the light shining forwards and backwards and getting cut off depending on how the player's view is angled. This gets more severe the wider the beam is in relation to the length.

This means that all projected lights in TDM use circular falloff images. This is also bad, since the light beam will have a constant light intensity until it abruptly cuts off to black at the end of its reach.

Several assets depend on projection lights working correctly, most importantly the security camera.
Steps To ReproduceI've attached:
- a test FM with a rotating spotlight. The player starts in the intended light cone and is rotated so that he can also see the backwards light projection on the far side of the room.
- a screenshot of the starting view in the test FM
- a .jpg of the falloff image. The original .tga can be found in the FM's lights folder.
Additional Information- I encountered this problem for the first time in 2016.
- I believe the falloff image is rotated correctly, since all 3 other rotations cause the light to reach far longer than it should.
TagsNo tags attached.

Relationships

child of 0005528 assignedDragofer Improvements to security cameras 

Activities

Dragofer

Dragofer

09.02.2021 12:29

developer  

test_proj.pk4 (131,034 bytes)
falloff.jpg (252,110 bytes)   
falloff.jpg (252,110 bytes)   
falloff_gradient04.jpg (1,940 bytes)   
falloff_gradient04.jpg (1,940 bytes)   
nbohr1more

nbohr1more

09.02.2021 13:11

developer   ~0013670

The material def for the light is using the biground1 texture, was that intentional?

lights/spotlight_security_camera
{

    lightFalloffImage makeintensity( lights/falloff_gradient04 )
    {
        forceHighQuality
        map lights/biground1
        colored
        zeroClamp
        red ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm0
        green ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm1
        blue ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm2
    }

}


Shouldn't it be using your custom projection image? :


lights/spotlight_security_camera
{

    lightFalloffImage makeintensity( lights/falloff_gradient04 )
    {
        forceHighQuality
        map lights/spotlight_security_camera
        colored
        zeroClamp
        red ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm0
        green ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm1
        blue ((.02 * sintable [(time * ( 1 + Parm3 ) ) ]) +1.68) * Parm2
    }

}
Dragofer

Dragofer

09.02.2021 14:59

developer   ~0013671

Ah yeah, I didn't mean to include my custom projection image in the .pk4. The problem is the same with either projection image.
Dragofer

Dragofer

15.02.2021 09:09

developer   ~0013684

Relevant post on code for projection lights by stgatilov here:
https://forums.thedarkmod.com/index.php?/topic/20768-security-cameras/&do=findComment&comment=456655
Judith

Judith

04.03.2021 23:15

reporter   ~0013761

I experimented with projection textures long time ago, so my memory might fail me, isn't the falloff image wrong? The falloff gradient should be billinear, so the light materials works for both omni and projected lights, as in the classic example: https://wiki.thedarkmod.com/index.php?title=File:LT_Projectedlight.png

Issue History

Date Modified Username Field Change
09.02.2021 12:29 Dragofer New Issue
09.02.2021 12:29 Dragofer File Added: test_proj.pk4
09.02.2021 12:29 Dragofer File Added: falloff.jpg
09.02.2021 12:29 Dragofer File Added: falloff_gradient04.jpg
09.02.2021 12:30 Dragofer Relationship added child of 0005528
09.02.2021 12:35 Dragofer Description Updated View Revisions
09.02.2021 12:36 Dragofer Description Updated View Revisions
09.02.2021 13:11 nbohr1more Note Added: 0013670
09.02.2021 14:59 Dragofer Note Added: 0013671
15.02.2021 09:09 Dragofer Note Added: 0013684
04.03.2021 23:15 Judith Note Added: 0013761