View Issue Details

IDProjectCategoryView StatusLast Update
0004182The Dark ModDesign/Codingpublic13.11.2016 16:12
ReporterSteveL Assigned ToSteveL  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.03 
Target VersionTDM 2.05Fixed in VersionTDM 2.05 
Summary0004182: Glass crack decals are not visible against skybox backdrop
DescriptionIn my test map Springheel's new crack decal isn't visible against skybox (using portalsky). That might well have been the case with the old bullethole too.
TagsNo tags attached.

Relationships

related to 0004204 resolvedSteveL Spiderwebs light up when lightning is triggered 
related to 0004212 new Glass cracks don't show up in player lantern 
related to 0004414 resolvedduzenko See if skybox can be rendered faster 
child of 0004177 new Func_fractures overhaul 

Activities

SteveL

SteveL

23.07.2015 18:40

developer   ~0007663

It's specifically portal sky that hides the foreground decals. Caulk sky shows them up ok. Caulk sky draws before *anything* in the scene. Portal sky draws later.. is it drawing after the decals?
SteveL

SteveL

23.07.2015 19:02

developer   ~0007664

Yes the crack decal is being painted before the portalsky. Not immediately clear why that is since portalsky has a sort of 2 and the decal uses decal_macro which should give it a sort of 1.
SteveL

SteveL

29.07.2015 16:03

developer   ~0007670

I'm parking this for later because it's confusing and taking too much time. No doubt all this can be untangled.

Mysterious findings so far:
The decals are drawn with sort 0, because they're translucent and therefore light-interacting. Their sort parameter is ignored.
The decal is drawn by the translucent interaction code -- confirmed.
But it doesn't behave translucent. The black parts do not darken the background by 50%.
On the other hand, the cracks are not visible in 0 light. They need light but they don't respond to the player lantern???
Heat haze gets applied afterwards, after all the above and it should distort all the above.
SteveL

SteveL

08.09.2015 17:32

developer   ~0007762

"But it doesn't behave translucent. The black parts do not darken the background by 50%."
That was a misunderstanding on my part. TDM doesn't use screen-door translucency for lit transparencies, it uses an additive blend, adding the brightness of the lit translucent surface to the colour of the solid background.

Portalsky draws after lit transparencies, and it draws all over the solid surface that it's on, and it wipes out the lit decal in front that got drawn earlier. Caulk sky doesn't have the problem because it doesn't re-draw the sky over its surface. It doesn't draw anything, it simply exposes the earlier rendering pass that drew the skybox all over the screen at the beginning of the frame.

The only way to fix this would be to change the glass crack decal so that it's no longer light-interacting, so it has a constant brightness. But that would make it look like it's glowing strangely in dark places unless the mapper tweaks the rgb settings. Hmm, I'm not sure it should be fixed. I suspect that mappers would have to mess with settings more often after the fix than they would without the fix.
SteveL

SteveL

08.09.2015 17:45

developer   ~0007763

Last edited: 08.09.2015 18:09

View 2 revisions

Actually there could be a fix: make portal sky draw with an additive blend too, instead of the default opaque (GLS_SRCBLEND_ONE, GLS_DSTBLEND_ZERO).

Normally portalsky will be drawing on black anyway, so it'll make no difference. Only 1 solid surface is ever drawn on any given pixel: the surface that matches the depth buffer. The only time there'd be some colour already in the buffer is when a light-interacting translucent surface has been drawn onto the same region of screen as the portalsky.

The other time would be when portalsky is z-fighting with some other surface, but mappers will fix that.

SteveL

SteveL

08.09.2015 18:50

developer   ~0007764

That worked, in a test map and in a fly-through of WS2 which has complex skies.

Rev 14380

/trunk/materials/tdm_portal_sky.mtr
SteveL

SteveL

26.09.2015 18:59

developer   ~0007801

Re-opening because the portalsky texture is now transparent in DR, which isn't desirable.
SteveL

SteveL

30.09.2015 18:20

developer   ~0007814

I've added a hack to stop portsky being transparent in DR -- added a diffusemap stage with a condition that means it'll never be drawn in game.

I'll leave the tracker open while I consult on whether there's a better fix in the dev forum.

at rev 14395

/trunk/materials/tdm_portal_sky.mtr
SteveL

SteveL

02.10.2015 19:50

developer   ~0007832

Feedback was the hack is preferable to the transparency.

Issue History

Date Modified Username Field Change
21.07.2015 17:26 SteveL New Issue
21.07.2015 17:26 SteveL Status new => assigned
21.07.2015 17:26 SteveL Assigned To => SteveL
21.07.2015 17:26 SteveL Relationship added child of 0004177
23.07.2015 18:40 SteveL Note Added: 0007663
23.07.2015 19:02 SteveL Note Added: 0007664
29.07.2015 16:03 SteveL Note Added: 0007670
08.09.2015 17:32 SteveL Note Added: 0007762
08.09.2015 17:45 SteveL Note Added: 0007763
08.09.2015 18:05 SteveL Relationship added related to 0004204
08.09.2015 18:07 SteveL Relationship added related to 0004212
08.09.2015 18:09 SteveL Note Edited: 0007763 View Revisions
08.09.2015 18:50 SteveL Note Added: 0007764
08.09.2015 18:50 SteveL Status assigned => resolved
08.09.2015 18:50 SteveL Fixed in Version => TDM 2.04
08.09.2015 18:50 SteveL Resolution open => fixed
26.09.2015 18:59 SteveL Note Added: 0007801
26.09.2015 18:59 SteveL Status resolved => assigned
30.09.2015 18:20 SteveL Note Added: 0007814
30.09.2015 18:45 SteveL Status assigned => suspended
02.10.2015 19:50 SteveL Note Added: 0007832
02.10.2015 19:50 SteveL Status suspended => resolved
04.01.2016 19:23 grayman Fixed in Version TDM 2.04 => TDM 2.05
04.01.2016 19:23 grayman Target Version TDM 2.04 => TDM 2.05
13.11.2016 16:12 duzenko Relationship added related to 0004414