Changeset 1730 for trunk/tutorial/08_fbo.lolfx
- Timestamp:
- Aug 13, 2012, 2:45:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tutorial/08_fbo.lolfx
r1574 r1730 3 3 #version 120 4 4 5 attribute vec2 in_Position; 6 7 varying vec2 pass_Position; 8 5 9 void main() 6 10 { 7 gl_Position = gl_Vertex;8 gl_ TexCoord[0] = gl_MultiTexCoord0;11 pass_Position = in_Position; 12 gl_Position = vec4(in_Position, 0.0, 1.0); 9 13 } 10 14 … … 13 17 #version 120 14 18 15 uniform sampler2D texture; 19 uniform sampler2D in_Texture; 20 uniform float in_Flag; 21 uniform vec3 in_Point; 22 uniform vec3 in_Color; 23 24 varying vec2 pass_Position; 16 25 17 26 void main(void) 18 27 { 19 gl_FragColor = vec4(texture2D(texture, gl_TexCoord[0].xy).xyz, 1.0); 28 if (in_Flag == 0.0) 29 { 30 float s = 4.0 + 4.0 * in_Point.z; 31 vec2 p = pass_Position - in_Point.xy * 0.8; 32 float f = clamp(1.0 - dot(s * p, s * p), 0.0, 1.0); 33 f = sqrt(f); 34 gl_FragColor = vec4(f * in_Color, f + 0.1); 35 } 36 else 37 { 38 vec2 texcoords = pass_Position * 0.5 + vec2(0.5, 0.5); 39 gl_FragColor = vec4(texture2D(in_Texture, texcoords).xyz, 1.0); 40 } 20 41 } 21 42
Note: See TracChangeset
for help on using the changeset viewer.