So in my endeavour to make the lighted material unlit at certain pixels I’ve used the glowmap texture to ignore lighting when the value is 1 and display lighting when it’s 0 (and interpolate in between).
Now what I’d need is a way to make the dlsr treat pixels as ShadowMode.Cast instead of ShadowMode.CastAndReceive depending on object’s material’s glowmap.
Sounds to me I’ll need my own version of the AbstractShadowRenderer to make it point at a modified version of the PreShadow and PostShadow shaders?
So @nehon (since you wrote the dlsr) and anyone else that would know, would this sort of thing be possible? And if you have any tips on how to approach it I’d greatly appreciate it since I’m sort of lost at the moment.
P. S.
In case this turns out to be completly unviable and impossible I can use the modified Lighting.j3md in tandem with the bloomfilter as it gives a decent result:
Oh, that makes more sense! Would it be the PreShadow, PostShadow or PostShadow15? I assume the PostShadows are for the shadow post filter and the preshadow for the dlsr?
I already deleted it, but what it did was discard the pixel if the glowmap value was > 0.5. Tried with < 0.5 too and messed with some other values like 0.9/0.7/0.3 etc.
I still can’t tell if it’s the PostShadow or PostShadow15. The code looks about 80% the same, though the 15 has an outFragColor parameter that it writes to and the other one does it straight to the gl_FragColor.
PostShadow15 supports multisampling and is used if you card supports GLSL>=1.50 (gl_FragColor is deprecated since 1.30) , so you would have to edit both of them if you don’t want to cut prior opengl3 support or multisampling.
I saw this in almost every filter, but i’m not sure why this way is preferred over GLSLCompat and __VERSION __ checks that would allow to support everything without duplicating the code…
you’re going to have a hard time with this…
one way could be to pass the highlights to the shadow post pass so that shadow is not rendered in those area… but it’s complicated because you’d need mrt and stuffs like that… which can potentially reduce your user base…
IMO your best bet is the bloom filter…
Ah true, I’ve just looked into it, and you are right, it seems from this line
That no shadow = vec4(1) , don’t know why it doesn’t work… maybe try to call discard instead, or yeah you could use the post filter that looks a lot easier to understand.