Why doesn't this shader work?

Started by
-1 comments, last by SlasherX 18 years, 4 months ago
Strange, it work with RenderMonkey but in my code it doesn't... The problem is I can't see the vertex's texture coordinates in pixel shader at stages 1,2 and 3...Just t0 works... I assign the same texture to all 4 stages. And my vertex stream format is: { { 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }, { 0,16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() } This is a simple glow shader... ------------------------------ vs_1_1 dcl_position v0 dcl_texcoord v1 mov oPos, v0 //I assign vi + ci to each 4 stage add oT0.xy, v1, c0 add oT1.xy, v1, c1 add oT2.xy, v1, c2 add oT3.xy, v1, c3 ------------------------------ ps_1_4 texld r0, t0 // OK texld r1, t1 // this stage doesn't come from mT1.xy texld r2, t2 // this stage doesn't come from mT2.xy texld r3, t3 // this stage doesn't come from mT3.xy mul r1, r1, c0 mad r0, r0, c0, r1 mad r0, r2, c0, r0 mad r0, r3, c0, r0 ------------------------------ Thanks, Galip

This topic is closed to new replies.

Advertisement