diff options
Diffstat (limited to 'Data/BuiltIn/Resources/Shaders/Editor-Shape.glsl')
-rw-r--r-- | Data/BuiltIn/Resources/Shaders/Editor-Shape.glsl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Data/BuiltIn/Resources/Shaders/Editor-Shape.glsl b/Data/BuiltIn/Resources/Shaders/Editor-Shape.glsl new file mode 100644 index 0000000..5ce755f --- /dev/null +++ b/Data/BuiltIn/Resources/Shaders/Editor-Shape.glsl @@ -0,0 +1,34 @@ +#version 330 core +//绘制纯色的几何图形 + +CMD_BEGIN +Cull Off +Blend SrcAlpha OneMinusSrcAlpha +DepthTest Off +CMD_END + +uniform mat4 gamelab_mat_mvp; +uniform sampler2D gamelab_main_tex; +uniform vec2 gamelab_ui_position; +uniform vec4 gamelab_color; + +VSH_BEGIN +layout (location = 0) in vec2 vPos; + +void main() +{ + vec2 pos = vPos + gamelab_ui_position; + vec4 clipPos = gamelab_mat_mvp * vec4(pos, -1, 1.0); + gl_Position = clipPos; +} +VSH_END + +FSH_BEGIN + +out vec4 FragColor; + +void main() +{ + FragColor = gamelab_color; +} +FSH_END |