Jump to content
  • Advertisement
Sign in to follow this  
CadeF

DX8.1 Pixel Shader for Texture Perturbation problem

This topic is 4842 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

After reading ShaderX pdf about texture perturbation effects (from ati's developer section), I have tried to create the fire effect, in 2D. However, it does not look correct. What I get Picture from ShaderX My textures loaded are: Texture 0 Texture 1 Textures 2,3 and 4 My pixel shader is: ps.1.4 texcrd r0.rgb, t0 ; base coord texld r2, t1 ; noise0 texld r3, t2 ; noise1 texld r4, t3 ; noise2 mul r2.rgb, c1, r2_bx2 ; noise0 * dis0 mad r2.rgb, c2, r3_bx2, r2 ; noise1 * dis1 + noise0 * dis0 mad r2.rgb, c3, r4_bx2, r2 ; noise2 * dis2 + noise1 * dis1 + noise0 * dis0 +mad r0.a, r0.g, c4.x, c4.y ; scale and bias y coord of base map mad r2.rgb, r2, r0.a, r0 ; mult distortion by scaled biased y coord phase texld r0, r2 ; index base map with distorted tex coord texld r1, r2 ; index opacity map with distorted tex coord mul r0, r1, r0 ; scale base color by opacity But it appears that the only visible effect the shader has is that it outputs Texture 0 multiplied by Texture 1 Pixel Shader C Register contains c1: 0.123, 0.123, 0.123, 0.123 c2: 0.091, 0.091, 0.091, 0.091 c3: 0.0723, 0.0723, 0.0723, 0.0723 c4: 0.44, 0.29, 0, 1 And changing any of these registers seems to have no effect. And I am not using a vertex shader because 1) It is not specified in the pdf 2) I am rendering in 2D Can anyone please tell me what I am doing wrong or point me to an example, with source code, preferably 2D?

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!