beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
178 stars 95 forks source link

Add explicit way to tell the rendering phase in draw calls #1547

Open sprunk opened 2 weeks ago

sprunk commented 2 weeks ago

Apprently some DrawFoo callins run 2 or more times in a draw frame and you can't tell which iteration it currently is. See https://github.com/beyond-all-reason/Beyond-All-Reason/pull/3172

There should be some explicit way to tell:

Beherith commented 2 weeks ago
function widget:DrawWorldPreParticles() 
    -- NOTE: This is called TWICE per draw frame, once before water and once after, even if no water is present. 
    -- If water is present on the map, then it gets called again between the two for the refraction pass
    -- Solution is to draw it only on the first call, and draw reflections from widget:DrawWorldReflection
loveridge commented 4 days ago

I added parameters for DrawWorldPreParticles. Are there any other draw callins that happen multiple times per draw frame that you are aware of?