Sign in to follow this  

3d texture generation

This topic is 4853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

This topic is 4853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this