12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- precision mediump float;
- uniform float amount;
- uniform float tileOutline;
- uniform vec2 u_meshSize;
- uniform vec2 u_textureSize;
- varying float v_depth;
- varying vec2 v_uv;
- void main()
- {
-
-
- vec2 u_meshSize = u_meshSize.yx;
- vec4 c = vec4(1.0);
-
- c.a = 1.0 - v_depth;
-
- if (tileOutline >= 0.5) {
- float cell_width = u_textureSize.x / u_meshSize.y;
- float cell_height = u_textureSize.y / u_meshSize.x;
- float dd = 1.0;
- if (mod(v_uv.x * u_textureSize.x + dd, cell_width) < 2.0
- || mod(v_uv.y * u_textureSize.y + dd, cell_height) < 2.0) {
- if (amount > 0.0)
- c.rgb = vec3(1.0 - sqrt(amount));
- }
- }
- css_ColorMatrix = mat4(c.r, 0.0, 0.0, 0.0,
- 0.0, c.g, 0.0, 0.0,
- 0.0, 0.0, c.b, 0.0,
- 0.0, 0.0, 0.0, c.a);
- }
|