Sign in to follow this  
hl1202

Volume texture access

Recommended Posts

hl1202    100
Hi everyone,

I'm working on some problems which need to use volume texture.

My volume texture is created by a list of 300 images.
After creating the texture, i want to use 1 image (texture) from this volume texture.

How can i access 1 texture of the Volume texture and use it like normal texture. For example, i want to use the image (texture) 3 in volume texture to do like this

pd3dDevice->SetTexture (0,thirdTexture);

--------------------------------------

ps:
I wish i can use Volume Texture like an array, and just add the index to access the texture i want (ie. pVolumeTexture[i])

Share this post


Link to post
Share on other sites
belfegor    2834
If you are using dx9, by using shaders you can access individual slice like this:

sampler volumeSampler : register(s0);
...
texCoord = float3(IN.texCoord.xy, (1.0f / TotalSlicesInVolume) * SliceYouWant);
color = tex3D(volumeSampler, texCoord);

Share this post


Link to post
Share on other sites

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