Home Technical Talk

Emissive on textures

ajr2764
polycounter lvl 10
Offline / Send Message
ajr2764 polycounter lvl 10
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

  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    B, uses less memory. Compression on a 32bit 4 channel texture will result in it using as much memory as 2 1024's.
  • ajr2764
    Options
    Offline / Send Message
    ajr2764 polycounter lvl 10
    Thanks Xoliul , needed that technical information.
  • PhilipK
    Options
    Offline / Send Message
    PhilipK polycounter lvl 10
    Yes B for sure of those, but since you're working with UDK you're in luck as it supports using different UV channels. So you could map all areas that should be illuminated using a new UV channel on a small texture (perhaps 256x256 or so) and still have the same pixel density as the other texture maps!

    A bit more work, but may be worth it :)
  • ajr2764
    Options
    Offline / Send Message
    ajr2764 polycounter lvl 10
    Interesting idea PhillipK, will try that also if I have time.
  • Snader
    Options
    Offline / Send Message
    Snader polycounter lvl 15
    Another possibility, but might be a bit tricky, would be to extract from the current textures. Here's a short explanation of how:
    extract_alpha.PNG
    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.
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    I've used a second UV channel for emissive a bunch.

    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.
  • ajr2764
    Options
    Offline / Send Message
    ajr2764 polycounter lvl 10
    Okay so I have a few more questions that popped up and wondering about.

    -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.
  • kdm3d
    Options
    Offline / Send Message
    You can use the emmissive for lighting, but what I've found is it takes FOREVER to bake lighting using emmissive. Also, if I'm not mistaken, emmisive materials cant be used for dynamic lighting, static only.

    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.
  • ajr2764
    Options
    Offline / Send Message
    ajr2764 polycounter lvl 10
    Thanks alot for the info I'll try that stuff out later when I get back to UDK.
Sign In or Register to comment.