direct3d - Inputting Position Into the Pixel Shader -
in of programs have seen make use of vertex position data in pixel shader, there tendency process float4 vector. restriction not appear present fin other shaders. in program writing, instance, float2's inputted vs , float3's gs no problem. when try input data ps, rejects forms except float4. other vector types not allowed ps? if so, why?
in pixel shader, sv_position
system-generated value must float4
. when use sv_position
semantic in vertex shader, it's alias old position
semantic , comes input assembler in whatever format input layout specifies. binding between vertex , geometry shader has agree, can whatever value.
in other words, has special meaning pixel shader because it's pixel position computed rasterizer stage.
Comments
Post a Comment