View Issue Details

IDProjectCategoryView StatusLast Update
0004685The Dark ModGraphicspublic09.12.2017 16:10
ReporterSpooks Assigned Toduzenko  
Status resolvedResolutionfixed 
OSWindowsOS Version7 
Product VersionTDM 2.05 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004685: Foglights, Particles and portal_sky
DescriptionParticles get fogged up too much when they are in front of a portal_sky texture that is also being affected by a foglight.

I should say this isn't a particle system issue per se, but the way blend modes in material definitions interact with fog and the portal_sky texture.
Steps To ReproducePlace a prefab skybox in your map, place portal_sky textures in order to see it.
Place a foglight in your map, make sure it touches your portal_sky texture. Make sure your foglight has the noFogBoundary spawnarg set to "0" so it fogs up the portal_sky.
Spawn a transparent particle/an entity with one. A good example is the arc_light streetlight.
Watch the particle be overly fogged when in front of the portal_sky and properly fogged when in front of normal textures.
Additional InformationI have tried all sorting modes in my custom particles' material definitions (sort nearest, etc) and different blending modes with no satisfactory workaround to this issue.

There is a similar issue with blending modes being fullbright or sorting wrong when foglights are present, which is probably due to modes like "blend blend" or "blend add" not interacting with other lights. This can be observed in VanishedOne's ornate glass materials introduced in 2.05.
TagsNo tags attached.




25.11.2017 17:18


particle sorting.png (1,231,561 bytes)


26.11.2017 07:59

developer   ~0009705

Can you attach a test map please. I am clueless with dark radiant.


26.11.2017 10:26

reporter (16,739 bytes)


26.11.2017 10:29

reporter   ~0009706

I've attached a test map, you can move sideways to see how the particles (both the arc_light particle and the func_emitter one) look against the wall textures and the sky_portal.

Note that this is a 2.05 issue and while it'd be great to have it sorted in the next version it could be slated for 2.07.


02.12.2017 08:57

developer   ~0009725

The problem here appears to be the engine limitation.
I guess we would need to do fog before transparent surfaces and somehow downmodulate those separately.


02.12.2017 12:09

developer   ~0009726

I think that all ambient-only translucent materials are generally incompatible with TDM fog. It's not just the skybox, but any object far enough to cause enough fogging color component.


02.12.2017 12:35

developer   ~0009727

Added new material flag: sort afterfog
Applied it to material textures/particles/dustcloud and that seems to fixed the fog overdraw.
This only works well for ambient-only materials, that weren't fogged before, like the waterfall in the test map.


02.12.2017 12:39

developer   ~0009728

Although this has not been completely resolved I am changing the status to resolved pending testing feedback.

At revision: 7326 (code), 15103 (assets)


06.12.2017 14:00

reporter   ~0009736

The afterfog keyword looks great but I have discovered one major issue. Whenever there is a material with "sort afterfog" present in the player's view, all materials with a heatHaze fragment program disappear completely.

Just to be sure I also tested this with heatHazewithDepth, due to the mass replace, and the result was the same - the material disappears from view.


06.12.2017 20:45

developer   ~0009740

Test map please?


07.12.2017 15:45

reporter (18,641 bytes)


07.12.2017 15:48

reporter   ~0009746

Test map added. Look around or toggle r_skipParticles to see the problem. The waterfall particle has a large radius so I have put it further back so that the player can turn around and get it out of their view cone in order for the warp materials to pop back up.


09.12.2017 08:55

developer   ~0009749

At revision: 7338

Issue History

Date Modified Username Field Change
25.11.2017 17:18 Spooks New Issue
25.11.2017 17:18 Spooks File Added: particle sorting.png
26.11.2017 07:59 duzenko Note Added: 0009705
26.11.2017 10:26 Spooks File Added:
26.11.2017 10:29 Spooks Note Added: 0009706
29.11.2017 09:04 duzenko Assigned To => duzenko
29.11.2017 09:04 duzenko Status new => assigned
02.12.2017 08:57 duzenko Note Added: 0009725
02.12.2017 12:09 duzenko Note Added: 0009726
02.12.2017 12:35 duzenko Note Added: 0009727
02.12.2017 12:39 duzenko Note Added: 0009728
02.12.2017 12:39 duzenko Status assigned => resolved
02.12.2017 12:39 duzenko Fixed in Version => TDM 2.06
02.12.2017 12:39 duzenko Resolution open => fixed
06.12.2017 14:00 Spooks Note Added: 0009736
06.12.2017 14:00 Spooks Status resolved => feedback
06.12.2017 14:00 Spooks Resolution fixed => reopened
06.12.2017 20:45 duzenko Note Added: 0009740
07.12.2017 15:45 Spooks File Added:
07.12.2017 15:48 Spooks Note Added: 0009746
07.12.2017 15:48 Spooks Status feedback => assigned
09.12.2017 08:55 duzenko Note Added: 0009749
09.12.2017 08:55 duzenko Status assigned => resolved
09.12.2017 08:55 duzenko Resolution reopened => fixed
09.12.2017 16:10 grayman Target Version => TDM 2.06