【发布时间】:2019-06-23 02:20:25
【问题描述】:
在 HLSL 中我可以写:
struct vertex_in
{
float3 pos : POSITION;
float3 normal : NORMAL;
float2 tex : TEXCOORD;
};
并将此结构用作顶点着色器的输入:
vertex_out VS(vertex_in v) { ... }
GLSL 中有类似的东西吗?还是我需要写类似的东西:
layout(location = 0) in vec4 aPosition;
layout(location = 1) in vec4 aNormal;
...
【问题讨论】: