fixed the light problem,
very basic light at the moment, needs a lot of work: - custom position, - custom intensities, - calculate at better positions, others: - adjust zoom speed
This commit is contained in:
@@ -4,8 +4,9 @@ precision mediump int;
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform mat3 n_matrix;
|
||||
//uniform mat3 n_matrix;
|
||||
uniform sampler2D texture;
|
||||
uniform mat4 norm_matrix;
|
||||
uniform mat4 m_matrix;
|
||||
|
||||
uniform struct Light {
|
||||
@@ -21,7 +22,7 @@ varying vec3 v_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
mat3 normalMatrix = transpose(inverse(mat3(m_matrix)));
|
||||
mat3 n_matrix = transpose(inverse(mat3(norm_matrix * m_matrix)));
|
||||
vec3 normal = normalize(n_matrix * v_normal);
|
||||
|
||||
vec3 surfaceToLight = light.position - v_position;
|
||||
|
Reference in New Issue
Block a user