pixel shader 1.3 with hlsl
hi. i wrote this short and simple shader -
float k = input.RefractionVector.w;
float Fresnel = input.ReflectionVector.w;
//Retrive sky and botoom colors from cubemap.
float3 SkyColor = texCUBE(SkySampler, input.ReflectionVector);
float3 BottomColor = texCUBE(SkySamplerRefract, input.RefractionVector);
//Now compute final color.
float3 Final;
Final = Fresnel*SkyColor;
return Final.xyzz;
but it doesnt compile. if i dont mul the SkyColor with the Fresnel float it does work, and this code compiles good with ps 2_sw, so is it impossibile to do such simple shader in ps1_3??
*Maybe* the instruction count > ps_1_3_instruction count (12)
Doesn''t the compiler complain about anything?
Cheers,
Muhammad Haggag
Doesn''t the compiler complain about anything?
Cheers,
Muhammad Haggag
Don''t ever use swizzles in ps_1_x if you don''t need to. They are VERY expensive.
Change your last line to:
return float4(Final,0);
And it will likely do much better.
Change your last line to:
return float4(Final,0);
And it will likely do much better.
quote:Original post by ofer
well, i found out that using the w component is illigal.
Yes, if they are marked as texcoords (they are also clamped from 0 to 1 on < 1_4). Colors can access all 4 components.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement