Archived

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

Baltz

pixel shader won't compile with HLSL

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