adjust light functionality,

bugs:
- background cannot be changed during runtime
This commit is contained in:
Anakin
2017-01-18 17:01:43 +01:00
parent a521dfc292
commit 4c177f2ddc
9 changed files with 75 additions and 35 deletions

View File

@@ -12,9 +12,9 @@ attribute vec4 a_position;
attribute vec2 a_texcoord;
attribute vec3 a_normal;
varying vec2 v_texcoord;
varying vec3 v_position;
varying vec3 v_normal;
varying vec2 v_surfaceUV;
varying vec3 v_surfacePosition;
varying vec3 v_surfaceNormal;
void main()
{
@@ -23,7 +23,7 @@ void main()
// Pass data to fragment shader
// Value will be automatically interpolated to fragments inside polygon faces
v_texcoord = a_texcoord;
v_position = vec3(norm_matrix * m_matrix * a_position);
v_normal = a_normal;
v_surfaceUV = a_texcoord;
v_surfacePosition = vec3(norm_matrix * m_matrix * a_position);
v_surfaceNormal = a_normal;
}