/
BaseColor.txt
42 lines (34 loc) · 953 Bytes
/
BaseColor.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<shader>{
"name":"BaseColor",
"ubo":[ "UBOTransform" ],
"options": { "modelMatrix":true },
"uniforms":[
{ "name":"u_color", "type":"vec3" }
]
}<\shader>
<materials>[
{ "name":"BaseColorRed", "uniforms":[{ "name":"u_color", "type":"rgb", "value":"ff0000" }] },
{ "name":"BaseColorGreen", "uniforms":[{ "name":"u_color", "type":"rgb", "value":"00ff00" }] },
{ "name":"BaseColorGray", "uniforms":[{ "name":"u_color", "type":"rgb", "value":"a0a0a0" }] }
]<\materials>
<vertex>
#version 300 es
layout(location=0) in vec3 a_position;
uniform UBOTransform{
mat4 projViewMatrix;
vec3 cameraPos;
float globalTime;
vec2 screenSize;
};
uniform mat4 u_modelMatrix;
void main(void){
gl_Position = projViewMatrix * u_modelMatrix * vec4(a_position, 1.0);
}
<\vertex>
<fragment>
#version 300 es
precision mediump float;
uniform vec3 u_color;
out vec4 oFragColor;
void main(void){ oFragColor = vec4(u_color, 1.0); }
<\fragment>