Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 01-01 02:48:18.633 16822-16989/? I/PRNT: VPROG_TEXT:
- #if MOBILE
- #if FSHADER
- precision mediump float; // The SGS II device (the Mali 400MP) cannot support highp in the fragment shader.
- precision mediump int;
- #else
- precision highp float;
- precision highp int;
- #endif
- #define HIGHP highp
- #define MEDIUMP mediump
- #define LOWP lowp
- #else
- #include "prefix.glsl"
- #if TONE_MAP
- #define VSHADER_TONE_ONLY 1
- #include "tone_map.glsl"
- #endif
- #define HIGHP
- #define MEDIUMP
- #define LOWP
- #endif
- #line 15
- #define BILLBOARD_MODE_SQUARE 0
- #define BILLBOARD_MODE_AXIAL 1
- #define BILLBOARD_MODE_RIBBON 2
- uniform mat4 u_mv_matrix;
- uniform mat4 u_proj_matrix;
- uniform vec4 u_grid; // x-count, y-count, recip x, recip y grid x, grid y, 1/ grid x, 1/grid y
- uniform vec3 u_diffuse;
- uniform vec3 u_ambient;
- varying MEDIUMP vec2 v_texcoord0;
- varying MEDIUMP vec2 v_texcoord1;
- varying LOWP float v_blend; // inter-texture blend, rgb blend, alpha blend
- varying LOWP vec4 v_color;
- #define fog_ratio2 0.00001
- #if VSHADER
- // PER-VERTEX IN VBO
- attribu
- 01-01 02:48:18.633 16822-16989/? I/PRNT: te vec4 a_vertex;
- attribute vec3 a_normal; // velocity vector
- attribute vec4 a_color; // RGBA
- attribute vec3 a_texcoord0; // time, size, emissive
- attribute vec2 a_texcoord1; // semi xy, rotation
- // IMMEDIATE MODE FOR FAST TURN-AROUND
- attribute vec4 a_texcoord2; // first cell, cell count, diffuse, ambient
- attribute vec4 a_texcoord3; // axial coeff, 1/grid x, 1/grid y
- #define a_time a_texcoord0.x
- #define a_size a_texcoord0.y
- #define a_emissive a_texcoord0.z
- #define a_semi_xy a_texcoord1.x
- #define a_rotation a_texcoord1.y
- #define k_cell_first a_texcoord2.x
- #define k_cell_count a_texcoord2.y
- #define k_diffuse a_texcoord2.z
- #define k_ambient a_texcoord2.w
- #define a_grid_x a_texcoord3.x
- #define a_grid_y a_texcoord3.y
- #define a_grid_xy a_texcoord3.xy
- void main (void)
- {
- vec4 eye_pos = u_mv_matrix * a_vertex;
- vec2 semi = vec2(
- 4.0*fract(a_semi_xy)-1.0,
- 2.0*floor(a_semi_xy)-1.0);
- #if BILLBOARD_MODE == BILLBOARD_MODE_AXIAL || BILLBOARD_
- 01-01 02:48:18.633 16822-16989/? I/PRNT: MODE == BILLBOARD_MODE_RIBBON
- vec3 semi_y = mat3(u_mv_matrix) * a_normal;
- vec3 to_cam = -eye_pos.xyz;
- vec3 semi_x = a_size * normalize(cross(semi_y,to_cam));
- eye_pos.xyz += (semi_x * semi.x + semi_y * semi.y);
- #endif
- #if BILLBOARD_MODE == BILLBOARD_MODE_SQUARE
- float s = sin(a_rotation);
- float c = cos(a_rotation);
- mat2 spin = mat2(vec2(c,s),vec2(-s,c));
- eye_pos.xy += (spin * semi * a_size);
- #endif
- gl_Position = u_proj_matrix * eye_pos;
- #if MOBILE
- v_color.rgb = u_diffuse * k_diffuse +
- u_ambient * k_ambient +
- a_emissive;
- #else
- v_color.rgb = gl_LightSource[0].diffuse.rgb * k_diffuse +
- gl_LightSource[0].ambient.rgb * k_ambient +
- a_emissive;
- #endif
- v_color.rgb *= a_color.rgb;
- v_color.a = a_color.a;
- float anim_cell = a_time * k_cell_count;
- v_blend = fract(anim_cell);
- float cell_0 = mod(anim_cell , k_cell_count) + k_cell_first;
- float cell_1 = mod(anim_cell+1.0, k_cell_count) + k_cell_first;
- 01-01 02:48:18.633 16822-16989/? I/PRNT: vec2 cell_0_xy, cell_1_xy;
- cell_0_xy.y = floor(cell_0 * a_grid_x);
- cell_0_xy.x = floor(cell_0 - cell_0_xy.y / a_grid_x);
- cell_1_xy.y = floor(cell_1 * a_grid_x);
- cell_1_xy.x = floor(cell_1 - cell_1_xy.y / a_grid_x);
- v_texcoord0 = a_grid_xy * (vec2(0.5,-0.5) * semi + 0.5 + cell_0_xy);
- v_texcoord1 = a_grid_xy * (vec2(0.5,-0.5) * semi + 0.5 + cell_1_xy);
- v_texcoord0.y = 1.0 - v_texcoord0.y;
- v_texcoord1.y = 1.0 - v_texcoord1.y;
- #if TONE_MAP
- vshader_tone_map(v_color.rgb);
- #endif
- }
- #endif
- #if FSHADER
- uniform LOWP sampler2D u_tex;
- void main()
- {
- #if CROSSFADE
- gl_FragColor = v_color * mix(
- texture2D(u_tex, v_texcoord0.st),
- texture2D(u_tex, v_texcoord1.st),
- v_blend);
- #else
- // No-crossfade case: processing of the sample is done entirely in the blending hardware;
- // on IOS cutting sw ALU ops is (surprisingly) worth it.
- gl_FragColor = v_color * texture2D(u_tex, v_texcoord0.st);
- #endif
- #if DEBUG
- gl_FragCol
- 01-01 02:48:18.633 16822-16989/? I/PRNT: or = vec4(0.1, 0.01, 0.004, 1.0);
- #endif
- }
- #endif
- 01-01 02:48:18.633 16822-16989/? I/PRNT: particle.glsl: 3:13: L0001: Unknown character '"'(34)
- 3:13: L0001: Unknown character '"'(34)
- 3:16: L0001: Unknown character '"'(34)
- 3:16: L0001: Unknown character '"'(34)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement