12345678910111213141516171819202122232425262728293031323334 |
- attribute highp vec3 inVertex;
- attribute mediump vec3 inNormal;
- attribute mediump vec2 inTexCoord;
- uniform highp mat4 MVPMatrix;
- uniform mediump vec3 LightDirection;
- uniform mediump float DisplacementFactor;
- varying lowp float LightIntensity;
- varying mediump vec2 TexCoord;
- uniform sampler2D sDisMap;
- void main()
- {
-
- mediump float disp = texture2D(sDisMap, inTexCoord).r * DisplacementFactor;
-
- gl_Position = MVPMatrix * vec4(inVertex + (inNormal * disp), 1.0);
-
- TexCoord = inTexCoord;
-
-
- LightIntensity = dot(inNormal, -LightDirection);
- }
|