Revision 23b733db
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/library/effect/VertexEffectDeform.java | ||
---|---|---|
113 | 113 |
+ "vec3 center = vUniforms[effect+1].yzw; \n" |
114 | 114 |
+ "vec3 ps = center-v; \n" |
115 | 115 |
+ "vec3 aPS = abs(ps); \n" |
116 |
+ "vec3 maxps = u_objD + abs(center); \n"
|
|
116 |
+ "vec3 maxps = u_Bounding + abs(center); \n"
|
|
117 | 117 |
+ "float d = degree_region(vUniforms[effect+2],ps); \n" |
118 | 118 |
+ "vec3 force = vUniforms[effect].xyz * d; \n" |
119 | 119 |
+ "vec3 aForce = abs(force); \n" |
src/main/java/org/distorted/library/effectqueue/EffectQueue.java | ||
---|---|---|
24 | 24 |
import org.distorted.library.effect.EffectType; |
25 | 25 |
import org.distorted.library.main.DistortedLibrary; |
26 | 26 |
import org.distorted.library.main.InternalMaster; |
27 |
import org.distorted.library.mesh.MeshBase; |
|
27 | 28 |
|
28 | 29 |
import java.util.ArrayList; |
29 | 30 |
import java.util.HashMap; |
... | ... | |
118 | 119 |
|
119 | 120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
120 | 121 |
|
121 |
public static void send( EffectQueue[] queues, float distance, float mipmap,
|
|
122 |
float[] projection, float inflate, float halfW, float halfH, float halfZ, int variant )
|
|
122 |
public static void send(EffectQueue[] queues, float distance, float mipmap, |
|
123 |
float[] projection, float inflate, MeshBase mesh, int variant )
|
|
123 | 124 |
{ |
124 |
((EffectQueueMatrix )queues[0]).send(distance, mipmap, projection, halfW, halfH, halfZ, variant);
|
|
125 |
((EffectQueueMatrix )queues[0]).send(distance, mipmap, projection, mesh, variant);
|
|
125 | 126 |
((EffectQueueVertex )queues[1]).send(inflate, variant); |
126 | 127 |
((EffectQueueFragment)queues[2]).send(variant); |
127 | 128 |
} |
src/main/java/org/distorted/library/effectqueue/EffectQueueMatrix.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.distorted.library.effect.EffectType; |
26 | 26 |
import org.distorted.library.effect.MatrixEffect; |
27 |
import org.distorted.library.mesh.MeshBase; |
|
27 | 28 |
import org.distorted.library.message.EffectMessageSender; |
28 | 29 |
|
29 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
36 | 37 |
private static float[] mMVPMatrix = new float[16]; |
37 | 38 |
private static float[] mViewMatrix= new float[16]; |
38 | 39 |
|
39 |
private static int[] mObjDH = new int[MAIN_VARIANTS]; |
|
40 |
private static int[] mBoundingH = new int[MAIN_VARIANTS]; |
|
41 |
private static int[] mStretchH = new int[MAIN_VARIANTS]; |
|
40 | 42 |
private static int[] mMVPMatrixH = new int[MAIN_VARIANTS]; |
41 | 43 |
private static int[] mMVMatrixH = new int[MAIN_VARIANTS]; |
42 | 44 |
|
... | ... | |
56 | 58 |
|
57 | 59 |
static void uniforms(int mProgramH, int variant) |
58 | 60 |
{ |
59 |
mObjDH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_objD"); |
|
61 |
mBoundingH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_Bounding"); |
|
62 |
mStretchH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_Stretch"); |
|
60 | 63 |
mMVPMatrixH[variant]= GLES31.glGetUniformLocation(mProgramH, "u_MVPMatrix"); |
61 | 64 |
mMVMatrixH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_MVMatrix"); |
62 | 65 |
} |
... | ... | |
79 | 82 |
// return a float which describes how much larger an object must be so that it appears to be (about) |
80 | 83 |
// 'marginInPixels' pixels larger in each direction. Used in Postprocessing. |
81 | 84 |
|
82 |
float magnify(float[] projection, int width, int height, float mipmap, float halfX, float halfY, float halfZ, float marginInPixels)
|
|
85 |
float magnify(float[] projection, int width, int height, float mipmap, MeshBase mesh, float marginInPixels)
|
|
83 | 86 |
{ |
84 | 87 |
mMinX = Integer.MAX_VALUE; |
85 | 88 |
mMaxX = Integer.MIN_VALUE; |
... | ... | |
90 | 93 |
|
91 | 94 |
Matrix.multiplyMM(mTmpMatrix, 0, projection, 0, mViewMatrix, 0); |
92 | 95 |
|
96 |
float halfX = mesh.getBoundingX(); |
|
97 |
float halfY = mesh.getBoundingY(); |
|
98 |
float halfZ = mesh.getBoundingZ(); |
|
99 |
|
|
93 | 100 |
mTmpPoint[0] = +halfX; mTmpPoint[1] = +halfY; mTmpPoint[2] = +halfZ; magnifyDir(); |
94 | 101 |
mTmpPoint[0] = +halfX; mTmpPoint[1] = +halfY; mTmpPoint[2] = -halfZ; magnifyDir(); |
95 | 102 |
mTmpPoint[0] = +halfX; mTmpPoint[1] = -halfY; mTmpPoint[2] = +halfZ; magnifyDir(); |
... | ... | |
143 | 150 |
|
144 | 151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
145 | 152 |
|
146 |
void send(float distance, float mipmap, float[] projection, float halfX, float halfY, float halfZ, int variant)
|
|
153 |
void send(float distance, float mipmap, float[] projection, MeshBase mesh, int variant)
|
|
147 | 154 |
{ |
148 | 155 |
Matrix.setIdentityM(mViewMatrix, 0); |
149 | 156 |
Matrix.translateM(mViewMatrix, 0, 0,0, -distance); |
... | ... | |
153 | 160 |
for(int i=mNumEffects-1; i>=0; i--) ((MatrixEffect)mEffects[i]).apply(mViewMatrix,mUniforms,i); |
154 | 161 |
Matrix.multiplyMM(mMVPMatrix, 0, projection, 0, mViewMatrix, 0); |
155 | 162 |
|
156 |
GLES31.glUniform3f( mObjDH[variant] , halfX, halfY, halfZ); |
|
163 |
GLES31.glUniform3f( mBoundingH[variant] , mesh.getBoundingX(), mesh.getBoundingY(), mesh.getBoundingZ()); |
|
164 |
GLES31.glUniform3f( mStretchH[variant] , mesh.getStretchX() , mesh.getStretchY() , mesh.getStretchZ() ); |
|
157 | 165 |
GLES31.glUniformMatrix4fv(mMVMatrixH[variant] , 1, false, mViewMatrix, 0); |
158 | 166 |
GLES31.glUniformMatrix4fv(mMVPMatrixH[variant], 1, false, mMVPMatrix , 0); |
159 | 167 |
} |
src/main/java/org/distorted/library/effectqueue/EffectQueuePostprocess.java | ||
---|---|---|
161 | 161 |
MeshBase mesh = node.getMesh(); |
162 | 162 |
DistortedEffects effects = node.getEffects(); |
163 | 163 |
|
164 |
float halfW = mesh.getBoundingX(); |
|
165 |
float halfH = mesh.getBoundingY(); |
|
166 |
float halfZ = mesh.getBoundingZ(); |
|
167 |
|
|
168 | 164 |
int width = buffer.getWidth(); |
169 | 165 |
int height = buffer.getHeight(); |
170 | 166 |
|
... | ... | |
183 | 179 |
|
184 | 180 |
float inflate=0.0f; |
185 | 181 |
|
186 |
matrix.send(distance, mipmap, projection, halfW, halfH, halfZ, 2);
|
|
182 |
matrix.send(distance, mipmap, projection, mesh, 2);
|
|
187 | 183 |
|
188 | 184 |
if( mHalo!=0.0f ) |
189 | 185 |
{ |
190 |
inflate = matrix.magnify(projection, width, height, mipmap, halfW, halfH, halfZ, mHalo);
|
|
186 |
inflate = matrix.magnify(projection, width, height, mipmap, mesh, mHalo);
|
|
191 | 187 |
} |
192 | 188 |
|
193 | 189 |
vertex.send(inflate,2); |
src/main/java/org/distorted/library/main/DistortedLibrary.java | ||
---|---|---|
441 | 441 |
GLES31.glUniform1ui(DistortedLibrary.mMainOITNumRecordsH, (int)(DistortedLibrary.mBufferSize*surface.mWidth*surface.mHeight) ); |
442 | 442 |
mesh.bindVertexAttribs(DistortedLibrary.mMainOITProgram); |
443 | 443 |
|
444 |
float halfX = mesh.getBoundingX(); |
|
445 |
float halfY = mesh.getBoundingY(); |
|
446 |
float halfZ = mesh.getBoundingZ(); |
|
447 | 444 |
float inflate = mesh.getInflate(); |
448 | 445 |
float distance = surface.mDistance; |
449 | 446 |
float mipmap = surface.mMipmap; |
450 | 447 |
float[] projection= surface.mProjectionMatrix; |
451 | 448 |
|
452 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, halfX, halfY, halfZ, 1 );
|
|
449 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 1 );
|
|
453 | 450 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() ); |
454 | 451 |
|
455 | 452 |
if( mesh.getShowNormals() ) |
456 | 453 |
{ |
457 | 454 |
DistortedLibrary.mMainProgram.useProgram(); |
458 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, halfX, halfY, halfZ, 0 );
|
|
455 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 0 );
|
|
459 | 456 |
displayNormals(queues,mesh); |
460 | 457 |
} |
461 | 458 |
} |
... | ... | |
473 | 470 |
GLES31.glUniform1i(DistortedLibrary.mMainTextureH, 0); |
474 | 471 |
mesh.bindVertexAttribs(DistortedLibrary.mMainProgram); |
475 | 472 |
|
476 |
float halfX = mesh.getBoundingX(); |
|
477 |
float halfY = mesh.getBoundingY(); |
|
478 |
float halfZ = mesh.getBoundingZ(); |
|
479 | 473 |
float inflate = mesh.getInflate(); |
480 | 474 |
float distance = surface.mDistance; |
481 | 475 |
float mipmap = surface.mMipmap; |
482 | 476 |
float[] projection= surface.mProjectionMatrix; |
483 | 477 |
|
484 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, halfX, halfY, halfZ, 0 );
|
|
478 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 0 );
|
|
485 | 479 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() ); |
486 | 480 |
|
487 | 481 |
if( mesh.getShowNormals() ) displayNormals(queues,mesh); |
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
69 | 69 |
private float[] mVertAttribs; // packed: PosX,PosY,PosZ, NorX,NorY,NorZ, InfX,InfY,InfZ, TexS,TexT |
70 | 70 |
private float mInflate; |
71 | 71 |
private float mBoundingX, mBoundingY, mBoundingZ; |
72 |
private float mStretchX, mStretchY, mStretchZ; |
|
72 | 73 |
|
73 | 74 |
private class Component |
74 | 75 |
{ |
... | ... | |
106 | 107 |
mBoundingY = by/2; |
107 | 108 |
mBoundingZ = bz/2; |
108 | 109 |
|
110 |
mStretchX = 1.0f; |
|
111 |
mStretchY = 1.0f; |
|
112 |
mStretchZ = 1.0f; |
|
113 |
|
|
109 | 114 |
mShowNormals = false; |
110 | 115 |
mInflate = 0.0f; |
111 | 116 |
mComponent = new ArrayList<>(); |
... | ... | |
124 | 129 |
mBoundingY = original.mBoundingY; |
125 | 130 |
mBoundingZ = original.mBoundingZ; |
126 | 131 |
|
132 |
mStretchX = original.mStretchX; |
|
133 |
mStretchY = original.mStretchY; |
|
134 |
mStretchZ = original.mStretchZ; |
|
135 |
|
|
127 | 136 |
mShowNormals = original.mShowNormals; |
128 | 137 |
mInflate = original.mInflate; |
129 | 138 |
|
... | ... | |
191 | 200 |
*/ |
192 | 201 |
public float getBoundingX() |
193 | 202 |
{ |
194 |
return mBoundingX; |
|
203 |
return mBoundingX*mStretchX;
|
|
195 | 204 |
} |
196 | 205 |
|
197 | 206 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
200 | 209 |
*/ |
201 | 210 |
public float getBoundingY() |
202 | 211 |
{ |
203 |
return mBoundingY; |
|
212 |
return mBoundingY*mStretchY;
|
|
204 | 213 |
} |
205 | 214 |
|
206 | 215 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
209 | 218 |
*/ |
210 | 219 |
public float getBoundingZ() |
211 | 220 |
{ |
212 |
return mBoundingZ; |
|
221 |
return mBoundingZ*mStretchZ;
|
|
213 | 222 |
} |
214 | 223 |
|
224 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
225 |
/** |
|
226 |
* Sometimes we want to display a Mesh on a rectangular screen. Then we need to stretch it by |
|
227 |
* different factors in x and y (or z) directions. If we also wanted do display some vertex effects |
|
228 |
* done on this mesh, let's say a bulge done by a Distort effect, and wanted the bulge to be round, |
|
229 |
* (i.e the same in x and y directions) then doing so without this method would be impossible. |
|
230 |
* |
|
231 |
* This sets 'stretch' factors in each 3 dimensions. All vertices of this Mesh will be premultiplied |
|
232 |
* by those factors in the very first line of the Vertex Shader, before any Effects are done on it. |
|
233 |
* Using this we can thus pre-stretch the mesh to aspect ratio equal to the surface we eventually |
|
234 |
* want to display the Mesh on, and this way we can achieve a round Distort bulge! |
|
235 |
* |
|
236 |
* This could also be used to pre-stretch a Rectangles Mesh to a size equal (in pixels) to the bitmap |
|
237 |
* this mesh is textured with - and this lets us work with all Effects in natural, pixel units. |
|
238 |
* |
|
239 |
* @param sx stretch factor in x. |
|
240 |
* @param sy stretch factor in y. |
|
241 |
* @param sz stretch factor in z. |
|
242 |
*/ |
|
243 |
public void setStretch(float sx, float sy, float sz) |
|
244 |
{ |
|
245 |
mStretchX = sx; |
|
246 |
mStretchY = sy; |
|
247 |
mStretchZ = sz; |
|
248 |
} |
|
249 |
|
|
250 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
251 |
/** |
|
252 |
* Returns the x-factor set by setStretch(). |
|
253 |
*/ |
|
254 |
public float getStretchX() |
|
255 |
{ |
|
256 |
return mStretchX; |
|
257 |
} |
|
258 |
|
|
259 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
260 |
/** |
|
261 |
* Returns the y-factor set by setStretch(). |
|
262 |
*/ |
|
263 |
public float getStretchY() |
|
264 |
{ |
|
265 |
return mStretchY; |
|
266 |
} |
|
267 |
|
|
268 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
269 |
/** |
|
270 |
* Returns the z-factor set by setStretch(). |
|
271 |
*/ |
|
272 |
public float getStretchZ() |
|
273 |
{ |
|
274 |
return mStretchZ; |
|
275 |
} |
|
276 |
|
|
215 | 277 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
216 | 278 |
/** |
217 | 279 |
* Not part of public API, do not document (public only because has to be used from the main package) |
... | ... | |
474 | 536 |
|
475 | 537 |
} |
476 | 538 |
} |
477 |
|
|
478 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
479 |
// all 4 APIs depreciated - being removed from the apps. When done, we will also remove the |
|
480 |
// premultiply of the Object vertices by m_objD in the vertex shader. |
|
481 |
|
|
482 |
@Deprecated |
|
483 |
public void setStretch(int sx, int sy, int sz) |
|
484 |
{ |
|
485 |
mBoundingX = sx/2.0f; |
|
486 |
mBoundingY = sy/2.0f; |
|
487 |
mBoundingZ = sz/2.0f; |
|
488 |
} |
|
489 |
|
|
490 |
@Deprecated |
|
491 |
public float getStretchX() |
|
492 |
{ |
|
493 |
return mBoundingX*2; |
|
494 |
} |
|
495 |
@Deprecated |
|
496 |
public float getStretchY() |
|
497 |
{ |
|
498 |
return mBoundingY*2; |
|
499 |
} |
|
500 |
@Deprecated |
|
501 |
public float getStretchZ() |
|
502 |
{ |
|
503 |
return mBoundingZ*2; |
|
504 |
} |
|
505 | 539 |
} |
506 | 540 |
|
507 | 541 |
|
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_objD; // half of object width x half of object height X half the depth; |
|
35 |
// point (0,0,0) is the center of the object |
|
36 |
|
|
34 |
uniform vec3 u_Bounding; // MeshBase.mBounding{X,Y,Z} |
|
35 |
uniform vec3 u_Stretch; // MeshBase.mStretch{X,Y,Z} |
|
37 | 36 |
uniform mat4 u_MVPMatrix; // the combined model/view/projection matrix. |
38 | 37 |
uniform mat4 u_MVMatrix; // the combined model/view matrix. |
39 | 38 |
uniform float u_Inflate; // how much should we inflate (>0.0) or deflate (<0.0) the mesh. |
... | ... | |
50 | 49 |
////////////////////////////////////////////////////////////////////////////////////////////// |
51 | 50 |
// The trick below is the if-less version of the |
52 | 51 |
// |
53 |
// t = dx<0.0 ? (u_objD.x-v.x) / (u_objD.x-ux) : (u_objD.x+v.x) / (u_objD.x+ux);
|
|
54 |
// h = dy<0.0 ? (u_objD.y-v.y) / (u_objD.y-uy) : (u_objD.y+v.y) / (u_objD.y+uy);
|
|
52 |
// t = dx<0.0 ? (u_Bounding.x-v.x) / (u_Bounding.x-ux) : (u_Bounding.x+v.x) / (u_Bounding.x+ux);
|
|
53 |
// h = dy<0.0 ? (u_Bounding.y-v.y) / (u_Bounding.y-uy) : (u_Bounding.y+v.y) / (u_Bounding.y+uy);
|
|
55 | 54 |
// d = min(t,h); |
56 | 55 |
// |
57 |
// float d = min(-ps.x/(sign(ps.x)*u_objD.x+p.x),-ps.y/(sign(ps.y)*u_objD.y+p.y))+1.0;
|
|
56 |
// float d = min(-ps.x/(sign(ps.x)*u_Bounding.x+p.x),-ps.y/(sign(ps.y)*u_Bounding.y+p.y))+1.0;
|
|
58 | 57 |
// |
59 |
// We still have to avoid division by 0 when p.x = +- u_objD.x or p.y = +- u_objD.y (i.e on the edge of the Object) |
|
58 |
// We still have to avoid division by 0 when p.x = +- u_Bounding.x or p.y = +- u_Bounding.y (i.e |
|
59 |
// on the edge of the Object). |
|
60 | 60 |
// We do that by first multiplying the above 'float d' with sign(denominator1*denominator2)^2. |
61 | 61 |
// |
62 | 62 |
// 2019-01-09: make this 3D. The trick: we want only the EDGES of the cuboid to stay constant. |
63 |
// the interiors of the Faces move! Thus, we want the MIDDLE of the PS/(sign(PS)*u_objD+S) !
|
|
63 |
// the interiors of the Faces move! Thus, we want the MIDDLE of the PS/(sign(PS)*u_Bounding+S) !
|
|
64 | 64 |
////////////////////////////////////////////////////////////////////////////////////////////// |
65 |
// return degree of the point as defined by the object cuboid (u_objD.x X u_objD.y X u_objD.z)
|
|
65 |
// return degree of the point as defined by the cuboid (u_Bounding.x X u_Bounding.y X u_Bounding.z)
|
|
66 | 66 |
|
67 | 67 |
float degree_object(in vec3 S, in vec3 PS) |
68 | 68 |
{ |
69 | 69 |
vec3 ONE = vec3(1.0,1.0,1.0); |
70 |
vec3 A = sign(PS)*u_objD + S;
|
|
70 |
vec3 A = sign(PS)*u_Bounding + S;
|
|
71 | 71 |
|
72 | 72 |
vec3 signA = sign(A); // |
73 | 73 |
vec3 signA_SQ = signA*signA; // div = PS/A if A!=0, 0 otherwise. |
74 | 74 |
vec3 div = signA_SQ*PS/(A-(ONE-signA_SQ)); // |
75 |
vec3 ret = sign(u_objD)-div;
|
|
75 |
vec3 ret = sign(u_Bounding)-div;
|
|
76 | 76 |
|
77 | 77 |
float d1= ret.x-ret.y; |
78 | 78 |
float d2= ret.y-ret.z; |
... | ... | |
131 | 131 |
float degree(in vec4 region, in vec3 S, in vec3 PS) |
132 | 132 |
{ |
133 | 133 |
vec3 PO = PS + region.xyz; |
134 |
float D = region.w*region.w-dot(PO,PO); // D = |OX|^2 - |PO|^2
|
|
134 |
float D = region.w*region.w-dot(PO,PO); // D = |OX|^2 - |PO|^2 |
|
135 | 135 |
|
136 | 136 |
if( D<=0.0 ) return 0.0; |
137 | 137 |
|
138 |
vec3 A = sign(PS)*u_objD + S;
|
|
138 |
vec3 A = sign(PS)*u_Bounding + S;
|
|
139 | 139 |
vec3 signA = sign(A); |
140 | 140 |
vec3 signA_SQ = signA*signA; |
141 | 141 |
vec3 div = signA_SQ*PS/(A-(vec3(1.0,1.0,1.0)-signA_SQ)); |
142 |
vec3 ret = sign(u_objD)-div; // if object is flat, make ret.z 0
|
|
142 |
vec3 ret = sign(u_Bounding)-div; // if object is flat, make ret.z 0
|
|
143 | 143 |
|
144 | 144 |
float d1= ret.x-ret.y; |
145 | 145 |
float d2= ret.y-ret.z; |
... | ... | |
164 | 164 |
|
165 | 165 |
void main() |
166 | 166 |
{ |
167 |
vec3 v = 2.0*u_objD*a_Position;
|
|
167 |
vec3 v = u_Stretch*a_Position;
|
|
168 | 168 |
vec3 n = a_Normal; |
169 | 169 |
|
170 |
v += (u_objD.x+u_objD.y)*u_Inflate*a_Inflate;
|
|
170 |
v += u_Inflate*u_Stretch*a_Inflate;
|
|
171 | 171 |
|
172 | 172 |
#if NUM_VERTEX>0 |
173 | 173 |
int effect=0; |
... | ... | |
181 | 181 |
#endif |
182 | 182 |
|
183 | 183 |
v_Position = v; |
184 |
v_endPosition = v + (0.3*u_objD.x)*n;
|
|
184 |
v_endPosition = v + 0.3*u_Stretch*n;
|
|
185 | 185 |
v_TexCoordinate = a_TexCoordinate; |
186 | 186 |
v_Normal = normalize(vec3(u_MVMatrix*vec4(n,0.0))); |
187 | 187 |
gl_Position = u_MVPMatrix*vec4(v,1.0); |
Also available in: Unified diff
Further corrections.