• Advertisement

Archived

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

pixel shader 1.3 with hlsl

This topic is 5454 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 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
Advertisement
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
well, i found out that using the w component is illigal.

Share this post


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

  • Advertisement