File tree Expand file tree Collapse file tree 4 files changed +25
-28
lines changed Expand file tree Collapse file tree 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;
311
412// noise shader from https://www.shadertoy.com/view/XXBcDz
513
@@ -42,6 +50,6 @@ float fbm( vec2 p )
4250void main()
4351{
4452 float n = fbm(var_texcoord0.xy);
45- gl_FragColor = vec4 (n, n, n, 1.0 );
53+ out_fragColor = vec4 (n, n, n, 1.0 );
4654}
4755
Original file line number Diff line number Diff line change @@ -7,18 +7,10 @@ vertex_constants {
77 name: "mtx_worldview"
88 type: CONSTANT_TYPE_WORLDVIEW
99}
10- vertex_constants {
11- name: "mtx_view"
12- type: CONSTANT_TYPE_VIEW
13- }
1410vertex_constants {
1511 name: "mtx_proj"
1612 type: CONSTANT_TYPE_PROJECTION
1713}
18- vertex_constants {
19- name: "mtx_normal"
20- type: CONSTANT_TYPE_NORMAL
21- }
2214fragment_constants {
2315 name: "time"
2416 type: CONSTANT_TYPE_USER
Original file line number Diff line number Diff line change 1+ #version 140
12
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;
66
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+ };
1512
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;
1915
2016void main()
2117{
22- vec4 p = mtx_worldview * vec4(position.xyz, 1.0);
18+ highp vec4 p = mtx_worldview * vec4(position.xyz, 1.0);
2319 var_texcoord0 = texcoord0;
20+
2421 gl_Position = mtx_proj * p;
2522}
2623
Original file line number Diff line number Diff line change 11[project]
2- title = Defold-examples
2+ title = material_noise
33version = 0.1
44
55[bootstrap]
You can’t perform that action at this time.
0 commit comments