Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


pixel shader won't compile with HLSL

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

Hi i wrote a pixel shader using HLSL but it won''t compile as it is float4 PS_Specular(float3 IN_normal:COLOR0, float3 IN_view:COLOR1) : COLOR { float3 normal = (IN_normal - 0.5) * 2; float3 halfangle = (IN_view - 0.5) * 2; float4 result = saturate(dot(normal, halfangle)); result = result * result; result = result * result; result = result * result; result = result * result; float4 selfsha = saturate((4*dot(normal, halfangle))); return result * selfsha; } error: maximmum temp register index exceeded i wrote an asm version of it and it works and here it is PixelShader = asm { ps_1_3 dp3_sat r0, v0_bx2, v1_bx2 mul r0.w, r0.w, r0.w mul r0.w, r0.w, r0.w mul r0.w, r0.w, r0.w mul r0, r0.w, r0.w dp3_x4 r1, v0_bx2, v1_bx2 mov_sat r1, r1 mul r0, r0, r1 }; does anyone know how to make the HLSL version of it work? thanks

Share this post

Link to post
Share on other sites

  • 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!