Revision 277eddbb
Added by Leszek Koltunski almost 4 years ago
src/main/res/raw/main_vertex_shader.glsl | ||
---|---|---|
31 | 31 |
out vec3 v_Normal; // |
32 | 32 |
out vec2 v_TexCoordinate; // |
33 | 33 |
|
34 |
uniform vec3 u_Stretch; // MeshBase.mStretch{X,Y,Z} |
|
35 | 34 |
uniform mat4 u_MVPMatrix; // the combined model/view/projection matrix. |
36 | 35 |
uniform mat4 u_MVMatrix; // the combined model/view matrix. |
37 | 36 |
uniform float u_Inflate; // how much should we inflate (>0.0) or deflate (<0.0) the mesh. |
... | ... | |
93 | 92 |
|
94 | 93 |
void main() |
95 | 94 |
{ |
96 |
vec3 v = u_Stretch*a_Position;
|
|
95 |
vec3 v = a_Position + u_Inflate*a_Inflate;
|
|
97 | 96 |
vec3 n = a_Normal; |
98 | 97 |
|
99 |
v += u_Inflate*u_Stretch*a_Inflate; |
|
100 |
|
|
101 | 98 |
#if NUM_VERTEX>0 |
102 | 99 |
int effect=0; |
103 | 100 |
|
... | ... | |
110 | 107 |
#endif |
111 | 108 |
|
112 | 109 |
v_Position = v; |
113 |
v_endPosition = v + (0.2*u_Stretch.x)*n;
|
|
110 |
v_endPosition = v + 0.4*n;
|
|
114 | 111 |
v_TexCoordinate = a_TexCoordinate; |
115 | 112 |
v_Normal = normalize(vec3(u_MVMatrix*vec4(n,0.0))); |
116 | 113 |
gl_Position = u_MVPMatrix*vec4(v,1.0); |
Also available in: Unified diff
Remove the MeshBase.{set/get}Stretch API altogether.