结构体

  • 声明
GLSL
struct Vertex {
	vec3 position;
}
点击展开查看更多
  • 使用
GLSL
void main() {
	Vertex vtx;
	vtx.position = vec3(1);
}
点击展开查看更多

接口块

  • 输出接口块
GLSL
out VertexOut {
	vec3 normal;
	vec2 texCoord;
} vs_out;
点击展开查看更多
  • 输入接口块:结构需要保持与输出时一致
GLSL
in VertexOut {
    vec3 normal;
    vec2 texCoord;
} vs_in;
点击展开查看更多
  • 使用
GLSL
void main() {
	vs_out.normal = vec3(1);
}
点击展开查看更多

版权声明

作者: Cheyne Xie

链接: https://chaim.eu.org/posts/4469781c/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键