3d texture generation

Started by
7 comments, last by snisarenko 19 years, 8 months ago
hey, I'm wondering if there is a way, or I know it's possible but I don't know how :), to generate 3d opengl texture from a loaded 1D and 2D texture, i had the idea of some nice lighting effects with my 3d attenuation using grills or symbols for the 2d textures, i don't think the 1d part has to be altered, I only have to use my texture loader to load the 2d texture encode the file format and use the image data i would upload with teximage2d into the 3d texture array somehow and then send it to the teximage3d to generate the 3d texture. Any ideas :)? Would be very useful and nice-looking I bet..
www.prsoftware.de
Advertisement
Since you need this for falloff/attenuation texture I sugest you don't load anything from disk. Just generate texture at runtime.
Create array of size^3 so it can hold intensity data. Then for each texel calculate distance from center. Then based on this distance calculate attenuation. I usualy use something like (1-dist^2)^2. Then send this array as texture data. Make sure you set warp mode to clamp to edge and border texels have value 0 so you don't have any wierd light/bright spots in your scene.
You should never let your fears become the boundaries of your dreams.
hmm well im talking about something like the fan effect from doom3, or a grill effect when a light shines through a grill.
www.prsoftware.de
OK, then sorry for the rambling in my last post :).
Anyways, how do you intend to use those textures with 3D ones? Use 'fan' texture and blur it in distance to simulate soft shadows or what?
You should never let your fears become the boundaries of your dreams.
3d textures is a bad ideia for what you want to do.,
Simply project the fan\grid texture with projective texturing , and clip the back projection.
mhhh doom3 does something similar
www.prsoftware.de
I don't think Doom3 uses a 3D texture. It's wasting too much texture memory for such effect. I'd recommend projective texturing as Bruno did. However I wouldn't go clipping back projection unless really needed. Or you can go cubemap texturing, where you're free to encode a full light projection (not limited to a spotlight like 2D projective texturing).
hmmmm ;), maybe it's just a dumb idea i had..
www.prsoftware.de
no projective texturing is really cool. you should try it.

This topic is closed to new replies.

Advertisement