我知道在顶点着色器中你这样做:
PixelInputType TextureVertexShader(VertexInputType input)
{
PixelInputType output;
// Change the position vector to be 4 units for proper matrix calculations.
input.position.w = 1.0f;
// Update the position of the vertices based on the data for this particular instance.
input.position.x += input.instancePosition.x;
input.position.y += input.instancePosition.y;
input.position.z += input.instancePosition.z;
// Calculate the position of the vertex against the world, view, and projection matrices.
output.position = mul(input.position, worldMatrix);
output.position = mul(output.position, viewMatrix);
output.position = mul(output.position, projectionMatrix);
// Store the texture coordinates for the pixel shader.
output.tex = input.tex;
return output;
}
在几何着色器中使用 instancedPosition 的等价物是什么?就像我想实例化一个由 1 个顶点组成的模型并为每个实例在几何着色器中制作一个四边形并将四边形的位置设置为对应的 instancePosition 的位置实例缓冲区中的实例。