Page 1 of 1
lightfilter & rtlights
Posted: Thu Aug 06, 2015 4:41 am
by KillPixel
I have a stained glass window properly coloring light that passes through it via lightfilter. However, the window is destructible, so I need away to remove the colored light once the glass has been destroyed. Is there already a way in q3map2 to specify a shader to be only affected by rtlights?
Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 6:25 am
by dONKEY
Shader swapping can be triggered yes. I think you would need to 'fake' the coloured lightmap with a decal though...I'm hoping someone will tell you I'm wrong, but that's the way I'd approach it.
Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 1:28 pm
by KittenIgnition
You cooulld isolate the lightmap on its page, find the shader (using external lightmaps), and use shaders triggering. In theory it's simple, but when you get complex maps it becomes a really big pain. There may be a way to make the surface(s) it's projecting on have their own lightmap page (using a different resolution lightmap is one way), which would make it easier.
I'm pretty sure using a decal would be way easier though

Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 3:12 pm
by Theftbot
Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 5:13 pm
by Eraser
Triggerable shaders always end up a bit wonky in my experience.
Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 5:26 pm
by KittenIgnition
Theyve worked great for me, but something like this would take some fiddling to get it right.
Re: lightfilter & rtlights
Posted: Thu Aug 06, 2015 8:52 pm
by KillPixel
Ah, interesting idea using a decal.
I should've mentioned, this is in Darkplaces. At the moment, it only supports single stage shaders... which rules out triggerable shaders :/. I was thinking maybe trying FBSP for the lightmap lightstyles, but it doesn't support that either. The solution I'm going to try currently is rtlights with cubemaps projecting the colored light/pattern.
Another bridge I'm going to have to cross in the future is a triggerable, play once animap. This way one could give the appearance of things 'powering up' in stead of toggling between only two states. I'm not sure if this is currently possible with Q3 shaders, regardless of engine.
Thanks for the ideas!
Re: lightfilter & rtlights
Posted: Fri Aug 07, 2015 12:53 pm
by KittenIgnition
I'm not 100% sure, but I think animated shaders use a global tiimer sort-of, in that if you trigger them at a random time during the level they may start playing somewhere in the middle of their animation. I could be wrong though, and they might always start at the very beginning. It feels like it was that way in moteof...
Re: lightfilter & rtlights
Posted: Sat Aug 08, 2015 6:45 am
by Eraser
Yeah KittenIgnition is right.
I tried to turn bodies of dead bots transparent with a shader in EntityPlus, but it wouldn't work because the shader would start somewhere in a random progress point of the transition.
The alternative was to sink the bodies into the floor after some time so I did that.