Ok so Im trying to figure out whats is the best approach. Im using UDK and my textures are 1024. I have several textures that have areas on them with lights. Would it be better if:
A. Save out a 32bit 1024 texture and use the alpha for the emissive in the material.
B. Create another texture just for the light section and make it perhaps a smaller rez like 512 or even 256.
I dont know what the difference in performance is or what most others would do. Thanks.
Replies
A bit more work, but may be worth it
You'll have to fiddle with the numbers a bit though.
Some notes:
-everything that has a value of 128 or higher(in my example) will become emissive. This of course means that medium gray (128;128;128) will get used, but also pixels with one strong channel such as 128;0;0 (red), 0;128;0(green), 0;0;128(blue), will become emissive.
-this means you'll have to make sure that there's a clear break between the emissive and non emissive parts. And preferably a bit of a brightness buffer too, to compensate for compression artifacts. But you can compensate for the extra brightness by applying the clamped alpha negatively over the diffuse. Kind of hard to explain, so if it doesn't make sense, I can make you an example.
-I think these are relatively cheap calculations, but if I'm wrong, please let me know.
First, I'll copy my channel 1 UVs to my channel 2 (so I don't have to re-unwrap anything), and then cut all of the unused stuff down and scale it down to a single point somewhere. Then I'll pack the new, emissive-only UVs as tight as I can. I'll go to my diffuse and temporarily black out everything except the glowing bits, and then bake the diffuse from channel 1 to channel 2, giving me a low-rez (usually using a 128x128 on an object thats using a 1024x512 or so) glow map that matches the diffuse perfectly. This also means if there is any distortion in my UVs that the emissive will map perfectly to the diffuse map.
-Since UDK has lightmass and you can use emissive textures for lighting, in what cases do you not even use a actual light. I have some blue lights in a texture with use emissive checked and it does a decent job of bouncing that blue light. What can this method do versus using actual lights.
-Would you make your light texture its full brightness in your diffuse, or make it brighter in the emissive map? It seems hooking my emissive map in blows out the light a little bit, I cant see the details hardly just white light.
-I ended up removing all the parts off the texture that wasnt the light surface and resizing to 256 for a emissive map. Seems to work okay but in some cases going from 1024 to 256 for the light looks a bit pixelated. I went up to 512 on a few to see but 512 still seems high. Maybe I should try the other methods suggested to keep the same rez with a less expensive texture.
Thanks for the help.
When hooking up your emmissive in your shader, multiply it by a constant. That way you can tweak your brighness in your shader and not have to reexport your texture each time. 2 in your constant makes it double brightnes, .5 makes it half brightness, etc.
When you remove all the non-glowing bits, make sure you rearrange your UV islands in the other channel. When you resize, you should be able to get close to the same texel density at a lower resolution.