[1574] | 1 | -- GLSL.Vert -- |
---|
| 2 | |
---|
| 3 | #version 120 |
---|
| 4 | |
---|
[1730] | 5 | attribute vec2 in_Position; |
---|
| 6 | |
---|
| 7 | varying vec2 pass_Position; |
---|
| 8 | |
---|
[1574] | 9 | void main() |
---|
| 10 | { |
---|
[1730] | 11 | pass_Position = in_Position; |
---|
| 12 | gl_Position = vec4(in_Position, 0.0, 1.0); |
---|
[1574] | 13 | } |
---|
| 14 | |
---|
| 15 | -- GLSL.Frag -- |
---|
| 16 | |
---|
| 17 | #version 120 |
---|
| 18 | |
---|
[1734] | 19 | #if defined GL_ES |
---|
| 20 | precision highp float; |
---|
| 21 | #endif |
---|
| 22 | |
---|
[1730] | 23 | uniform sampler2D in_Texture; |
---|
| 24 | uniform float in_Flag; |
---|
| 25 | uniform vec3 in_Point; |
---|
| 26 | uniform vec3 in_Color; |
---|
[1574] | 27 | |
---|
[1730] | 28 | varying vec2 pass_Position; |
---|
| 29 | |
---|
[1574] | 30 | void main(void) |
---|
| 31 | { |
---|
[1730] | 32 | if (in_Flag == 0.0) |
---|
| 33 | { |
---|
[1735] | 34 | float tc = 0.0, ta = 0.0; |
---|
| 35 | { |
---|
[1737] | 36 | float s = 6.0 + 3.0 * in_Point.z; |
---|
[1735] | 37 | vec2 p = pass_Position - in_Point.xy * 0.8; |
---|
| 38 | float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0); |
---|
[1737] | 39 | float u = t * t * t * t; |
---|
[1735] | 40 | tc += 3.0 * t * t - 2.0 * t * t * t; |
---|
| 41 | ta += 3.0 * u * u - 2.0 * u * u * u; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | gl_FragColor = vec4(tc * in_Color, ta + 0.1); |
---|
[1730] | 45 | } |
---|
| 46 | else |
---|
| 47 | { |
---|
| 48 | vec2 texcoords = pass_Position * 0.5 + vec2(0.5, 0.5); |
---|
| 49 | gl_FragColor = vec4(texture2D(in_Texture, texcoords).xyz, 1.0); |
---|
| 50 | } |
---|
[1574] | 51 | } |
---|
| 52 | |
---|
| 53 | -- HLSL.Vert -- |
---|
| 54 | |
---|
| 55 | void main(float2 in_Position : POSITION, |
---|
| 56 | out float4 out_Position : POSITION) |
---|
| 57 | { |
---|
| 58 | out_Position = float4(in_Position, 0.0, 1.0); |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | -- HLSL.Frag -- |
---|
| 62 | |
---|
| 63 | void main(out float4 out_FragColor : COLOR) |
---|
| 64 | { |
---|
| 65 | out_FragColor = float4(0.7, 0.2, 0.5, 1.0); |
---|
| 66 | } |
---|
| 67 | |
---|