1
0

Merging r5975 through r6036 from trunk to ogl-es branch.

GLES drivers adapted, but only did make compile-tests.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6038 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2020-01-03 19:05:16 +00:00
commit 2ae2a551a6
2007 changed files with 635880 additions and 0 deletions

34
media/ogles2.vert Normal file
View File

@@ -0,0 +1,34 @@
attribute vec3 inVertexPosition;
attribute vec3 inVertexNormal;
attribute vec4 inVertexColor;
attribute vec2 inTexCoord0;
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform vec3 mLightPos;
uniform vec4 mLightColor;
varying mediump vec4 v_color;
varying mediump vec2 v_texCoord;
void main(void)
{
gl_Position = mWorldViewProj * vec4(inVertexPosition,1.0);
vec4 normal = vec4(inVertexNormal, 0.0);
normal = mInvWorld * normal;
normal = normalize(normal);
vec4 worldpos = vec4(inVertexPosition,1.0) * mTransWorld;
vec4 lightVector = worldpos - vec4(mLightPos,1.0);
lightVector = normalize(lightVector);
float tmp2 = dot(-lightVector, normal);
vec4 tmp = mLightColor * tmp2;
v_color = vec4(tmp.x, tmp.y, tmp.z, 0.0);
v_texCoord = inTexCoord0;
}