Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello! Thank you for the kind words ^^

Yes, this is indeed a common problem, and depending on the effect, such as smoke, it might be better to draw the particle system manually at the desired depth and use a Direct Light with litType = LIT_EQUAL and intensity 1. This way, the light will illuminate only the depth where the particle is (you need to modify the light depth all the time in your case). And in fact, the Combine pass doesn't support depth because this is drawn after the lighting system is drawn (but on the same final surface).

Thank you for the prompt reply! 

I tested the suggested method on my project, but since the depth of my effects and objects changes dynamically, unintended objects get illuminated when they share the same depth. 

Is there any way to bind the light to illuminate only specific instances, instead of restricting by depth using `LIT_EQUAL`?

Or any other good approaches would be appriciated.

You're right, this is a limitation compared to forward rendering, where shaders are applied to each object individually (you just need to skip the lighting calculation to get something unlit). Since Crystal uses deferred rendering, everything naturally receives lighting, so to get something "unlit", you need to light it. The other alternative is to use the Combine pass, but it can only be drawn after everything.

(+1)

OK, I get how the engine works now! 

The "unlit" issue (excluding objects from lighting) is something I think I can work around in my project now, so that's solved for me.

However, the issue with the "EMISSIVE pass visual change" is definitely getting into the engine's internal settings, so I'd like to send you a few more detailed questions via email to discuss it further!

Thanks a bunch for your help! :)