Page 1 of 1

Ability to use brightmaps and texture shaders simultaneously

Posted: Sat May 19, 2018 4:26 am
by Marisa the Magician
I want to do a pulsing glow effect on an item (like UT pickups) but at the same time I don't want to lose the brightmapped parts.

Would it be difficult to make it so a texture shader with a custom ProcessLight can still sample the brightmap? At the moment it seems sampling from brighttexture just returns nothing.

Re: Ability to use brightmaps and texture shaders simultaneo

Posted: Sat May 19, 2018 5:11 am
by Graf Zahl
The problem here is: The brightmap *IS* a texture shader! You cannot use two at the same time.

Re: Ability to use brightmaps and texture shaders simultaneo

Posted: Sat May 19, 2018 5:55 am
by Marisa the Magician
True, but in the custom ProcessLight I should still be able to access the brighttexture sampler and do what the original brightmap texture shader does, then add the extra effect on top.

I suppose it's not bound in this case.

Re: Ability to use brightmaps and texture shaders simultaneo

Posted: Sat May 19, 2018 6:17 am
by Graf Zahl
No. This will have to wait anyway, because as things are there's far too many shaders being created already. I can't say if it makes sense, for example, to lump all texture shaders into a large switch/case block instead. On OpenGL you can change shaders on the fly, but on Vulkan you will need a complete pipeline object for each shader, possibly multiple ones, if other static pipeline components also need changing. I'm still in the very early stages of investigating Vulkan, so I do not want to make things more difficult then necessary by adding more complexity.

Re: Ability to use brightmaps and texture shaders simultaneo

Posted: Sat May 19, 2018 6:47 am
by Marisa the Magician
Ah, I expected it would come to this. I'll see about some workaround in the meantime.

Re: Ability to use brightmaps and texture shaders simultaneo

Posted: Tue May 18, 2021 12:25 pm
by Graf Zahl
Considering that I refactored the brightmap into the main shader this should be possible now.