今绘制三角形一直不显示:

 

后对比给出的例子发现是  PixelShader输入的Position应定义为 SV_POSITION而不是POSITION

 msdn上SV_POSITION的描述:

1.When used in a pixel shader, SV_Position describes the pixel location.

2.Available for read/write in the vertex shader and geometry shader.

3.The pixel shader can use it as read only to get the pixel center with a 0.5 offset.

1:SV_POSITION描述像素点的位置。  疑问:从VSShader变换World\View\Projection,投影矩阵变换后,   归一化裁剪, 映射匹配长宽都是系统做的了?

2.geometry shader的作用?

3.在Pixel shader里权限是只读sv_position, 得到像素中心点(position的0.5偏移)

   读写是在vertexShader和geometryShader

相关文章:

  • 2021-09-07
  • 2021-05-04
  • 2022-12-23
  • 2021-11-05
  • 2021-10-23
  • 2021-12-06
  • 2021-12-11
  • 2021-08-09
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-01-19
相关资源
相似解决方案