File tree 4 files changed +25
-28
lines changed
4 files changed +25
-28
lines changed Original file line number Diff line number Diff line change 1
- varying mediump vec2 var_texcoord0;
2
- uniform lowp vec4 time;
1
+ #version 140
2
+
3
+ in mediump vec2 var_texcoord0;
4
+
5
+ uniform fs_uniforms
6
+ {
7
+ mediump vec4 time;
8
+ };
9
+
10
+ out mediump vec4 out_fragColor;
3
11
4
12
// noise shader from https://www.shadertoy.com/view/XXBcDz
5
13
@@ -42,6 +50,6 @@ float fbm( vec2 p )
42
50
void main()
43
51
{
44
52
float n = fbm(var_texcoord0.xy);
45
- gl_FragColor = vec4 (n, n, n, 1.0 );
53
+ out_fragColor = vec4 (n, n, n, 1.0 );
46
54
}
47
55
Original file line number Diff line number Diff line change @@ -7,18 +7,10 @@ vertex_constants {
7
7
name: "mtx_worldview"
8
8
type: CONSTANT_TYPE_WORLDVIEW
9
9
}
10
- vertex_constants {
11
- name: "mtx_view"
12
- type: CONSTANT_TYPE_VIEW
13
- }
14
10
vertex_constants {
15
11
name: "mtx_proj"
16
12
type: CONSTANT_TYPE_PROJECTION
17
13
}
18
- vertex_constants {
19
- name: "mtx_normal"
20
- type: CONSTANT_TYPE_NORMAL
21
- }
22
14
fragment_constants {
23
15
name: "time"
24
16
type: CONSTANT_TYPE_USER
Original file line number Diff line number Diff line change
1
+ #version 140
1
2
2
- // Positions can be world or local space, since world and normal
3
- // matrices are identity for world vertex space materials.
4
- // If world vertex space is selected, you can remove the
5
- // normal matrix multiplication for optimal performance.
3
+ in highp vec4 position;
4
+ in mediump vec2 texcoord0;
5
+ in mediump vec3 normal;
6
6
7
- attribute highp vec4 position;
8
- attribute mediump vec2 texcoord0;
9
- attribute mediump vec3 normal;
10
-
11
- uniform mediump mat4 mtx_worldview;
12
- uniform mediump mat4 mtx_view;
13
- uniform mediump mat4 mtx_proj;
14
- uniform mediump mat4 mtx_normal;
7
+ uniform vp_uniforms
8
+ {
9
+ mediump mat4 mtx_worldview;
10
+ mediump mat4 mtx_proj;
11
+ };
15
12
16
- varying highp vec4 var_position;
17
- varying mediump vec3 var_normal;
18
- varying mediump vec2 var_texcoord0;
13
+ out highp vec4 var_position;
14
+ out mediump vec2 var_texcoord0;
19
15
20
16
void main()
21
17
{
22
- vec4 p = mtx_worldview * vec4(position.xyz, 1.0);
18
+ highp vec4 p = mtx_worldview * vec4(position.xyz, 1.0);
23
19
var_texcoord0 = texcoord0;
20
+
24
21
gl_Position = mtx_proj * p;
25
22
}
26
23
Original file line number Diff line number Diff line change 1
1
[project]
2
- title = Defold-examples
2
+ title = material_noise
3
3
version = 0.1
4
4
5
5
[bootstrap]
You can’t perform that action at this time.
0 commit comments