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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -