Archived

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

ofer

pixel shader 1.3 with hlsl

Recommended Posts

ofer    122
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??

Share this post


Link to post
Share on other sites
EvilDecl81    360
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.

Share this post


Link to post
Share on other sites
EvilDecl81    360
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.

Share this post


Link to post
Share on other sites