|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- -- GLSL.Vert --
-
- #version 120
-
- attribute vec2 in_Position;
-
- varying vec2 pass_Position;
-
- void main()
- {
- pass_Position = in_Position;
- gl_Position = vec4(in_Position, 0.0, 1.0);
- }
-
- -- GLSL.Frag --
-
- #version 120
-
- #if defined GL_ES
- precision highp float;
- #endif
-
- uniform sampler2D in_Texture;
- uniform float in_Flag;
- uniform vec3 in_Point;
- uniform vec3 in_Color;
-
- varying vec2 pass_Position;
-
- void main(void)
- {
- if (in_Flag == 0.0)
- {
- float tc = 0.0, ta = 0.0;
- {
- float s = 6.0 + 3.0 * in_Point.z;
- vec2 p = pass_Position - in_Point.xy * 0.8;
- float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0);
- float u = t * t * t * t;
- tc += 3.0 * t * t - 2.0 * t * t * t;
- ta += 3.0 * u * u - 2.0 * u * u * u;
- }
-
- gl_FragColor = vec4(tc * in_Color, ta + 0.1);
- }
- else
- {
- vec2 texcoords = pass_Position * 0.5 + vec2(0.5, 0.5);
- gl_FragColor = vec4(texture2D(in_Texture, texcoords).xyz, 1.0);
- }
- }
-
- -- HLSL.Vert --
-
- void main(float2 in_Position : POSITION,
- out float4 out_Position : POSITION)
- {
- out_Position = float4(in_Position, 0.0, 1.0);
- }
-
- -- HLSL.Frag --
-
- void main(out float4 out_FragColor : COLOR)
- {
- out_FragColor = float4(0.7, 0.2, 0.5, 1.0);
- }
-
|