Archived

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

InFerN0

Pixel Shader Errors

Recommended Posts

InFerN0    122
I am trying to use pixel shaders to do some image processing. It keeps telling me that the POSITION is invalid. Any ideas? Where in general do people go for help interperating errors? float4 ps_main( float2 pos : POSITION ) : COLOR0 { return float4(sin(length(pos) * 100.0) * 0.5 + 0.5, sin(pos.y * 50.0), 0, 1); } technique windowlevel { pass p0 { PixelShader = compile ps_2_0 ps_main(); } } Thanks. InFerN0 Not all who wander are lost...

Share this post


Link to post
Share on other sites
Nik02    4348
While the PS2.0 needs to be fed the position register, it cannot actually use it as a source register - it just forwards it to the final pass (PS3 can sample the pos register, though).
What you could do, is to feed the position into a texture coordinate register from the vertex shader, as even the most basic PS has no trouble readíng the coords from the input.

-Nik

EDIT: In general, when such error occurs, I refer to the SDK

[edited by - Nik02 on May 26, 2004 3:58:12 PM]

Share this post


Link to post
Share on other sites