# question about the depth component with volume textures

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

## Recommended Posts

hi, I want to use a volume texture in my program, but I don't understand how the depth texture coordinate works. For example, in 2D textures, u and v are in [0.0, 1.0], but with 3D textures, w don't seem to be in that range. I used the Texture tool given with the DirectX SDK to create a volume texture with 2 "volume depth", and in my program, the w components was between -0.25 and 0.25 (with w = -0.25, I have the first image of my 3D texture and with w = 0.25, the second one, and between, an interpolation of the 2 images) But if I create a volume texture with more than 2 "volume depth" the range of the w coordinates is not the same. I can't find the relation between the w coordinate and the number of volume depth. any help's welcomed. .:: Paic Citron ::.

##### Share on other sites
hum ... after a few hours and some hairs missing this is what i found on the subject :

1) the number of "layer" of the volume texture is rounded to the upper 2^N

2) the value of w to display the first layer of the volume texture is given by : 0.5 / (the rounded number of layers)

3) the step between each layer is : 1.0 / (the rounded number of layers)

...

I understand for the point 3). I didn't find it sooner because I didn't realize that directx was created new layers to make the number of layer a power of 2.
But I really don't understand why the w coordinate don't start at 0 !!!!!

Anyway, now I have the range of the w coordinate, and I can easily navigate through my volume texture.

.:: Paic Citron ::.

1. 1
2. 2
3. 3
4. 4
Rutin
19
5. 5

• 14
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
632927
• Total Posts
3009251
• ### Who's Online (See full list)

There are no registered users currently online

×