Jump to content
  • Advertisement
Sign in to follow this  

Why doesn't this shader work?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!