question about the depth component with volume textures

Started by
0 comments, last by paic 19 years, 8 months ago
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 ::.
Advertisement
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 ::.

This topic is closed to new replies.

Advertisement