View Full Version : Depth Textures & Dependant AR Textures

05-12-2003, 03:41 PM
I seem to be getting nothing but pure black as an output when I use my depth texture as the source operand for an AR lookup, I was assuming from the register combiner spec that the bound depth texture would output an alpha that could be used as a lookup, but it doesnt seem to work. Does anybody have any information in regards to using these extensions together?

[This message has been edited by JelloFish (edited 05-13-2003).]

[This message has been edited by JelloFish (edited 05-13-2003).]

05-13-2003, 04:09 PM
For clarification im refering to using nv_texture_shader to do the dependent ar texturing.

05-13-2003, 04:15 PM
Are you getting any errors or inconsistent stages?

05-13-2003, 04:44 PM
There are no glErrors and all stages return true for consistancy.

05-13-2003, 04:49 PM
def c0, 1, 1, 1, 120
texr t0
texr t1
texreg2ar t2, t0
mul r0.a, 1-t1.a, c0.a
cnd r0.a, r0.a, 1-zero, zero
mov r0.rgb, 1-zero
+mul r0.a, r0, t2.a

We are using a mocked up D3D PSH compiler to do our shaders, here is the code I am trying to work with. T0 is a depth texture, T1 is an alpha buffer of the scene, and T2 is a 2D Texture.

[This message has been edited by JelloFish (edited 05-13-2003).]

05-15-2003, 06:58 AM
Just to clarify, is this type of operation supposed to work?

05-16-2003, 11:58 AM
Sorry I made a small error in my response. I am getting an inconsistent stage on the Dep_AR stage when the depth texture is the previous input(I can switch the depth texture with the rgb one and not get a inconsistant stage). However I don't really understand why...

In the arb_depth_texture spec it says ...

(3) What happens when a depth texture is currently bound but RGBA texels are expected by the texture unit?

The depth texture is treated as if it were a LUMINANCE texture. It's sometimes useful to render a depth component texture as a grayscale texture.

And in the texture_shader spec they make no reference that depth textures don't work this way (with or without the use of Dep AR). However reference is made that If the previous texture input's texture shader result specified by the current texture shader stage's PREVIOUS_TEXTURE_INPUT_NV value has a texture shader result type other than RGBA (the DSDT_MAG_INTENSITY_NV base internal format does not count as an RGBA format type in this context), then this texture shader stage is not consistent.

So I suppose the texture shader spec could override the depth texture spec, however it does say in table 3D that Alpha, intensity, and Luminance (all shadow texture settings) textures bound should be expanded to RGBA. And would be usable by Dep_AR.

Perhaps a note should be made in the texture_shader spec about depth textures not performing according to the arb_depth_texture spec. Interestingly my driver doest advertise support for arb_depth_texture although, it does advertise support for arb_shadow, and in the arb_shadow spec it says that arb_depth_texture is required.

[This message has been edited by JelloFish (edited 05-21-2003).]