Is there an effective way to 'localize' light from textures?


(WolfWings) #1

Specifically, I’ve been working lately with some textures from Evil Lair lately, specifically the Q2-inspired set, and ran across an interesting situation.

There are some textures with lights on them, that are very localized compared to the texture as a whole. By localized I mean a single 32x64 rectangle out of a 512x256 texture actually has a light on it, and only that rectangle should ‘directly’ emit light.

So I was wondering if there’s an effective way to do this with Q3Map that won’t result in the numerous splits the ‘naive’ but functional solution of using a lit/unlit shader pair and splitting any surface using the texture to only use the ‘lit’ texture on the actual lights?


(ydnar) #2

Use a decal shader light, like in this map here:

http://www.shaderlab.com/q3map2/samples/shaderlab_sorting_fun.zip

The lights I’m referring to are on the sides of the pool. Jump in the water to see them.

y