diff options
Diffstat (limited to 'examples/web/shaders/shaders_rlgl_mesh_instanced.data')
| -rw-r--r-- | examples/web/shaders/shaders_rlgl_mesh_instanced.data | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/web/shaders/shaders_rlgl_mesh_instanced.data b/examples/web/shaders/shaders_rlgl_mesh_instanced.data index 3a5cdea..5ba3bb5 100644 --- a/examples/web/shaders/shaders_rlgl_mesh_instanced.data +++ b/examples/web/shaders/shaders_rlgl_mesh_instanced.data @@ -63,7 +63,7 @@ void main() precision mediump float; -// Input vertex attributes (from vertex shader) +// Input vertex attributes varying vec3 fragPosition; varying vec2 fragTexCoord; varying vec4 fragColor; @@ -73,11 +73,9 @@ varying vec3 fragNormal; uniform sampler2D texture0; uniform vec4 colDiffuse; -// NOTE: Add here your custom variables - -#define MAX_LIGHTS 4 -#define LIGHT_DIRECTIONAL 0 -#define LIGHT_POINT 1 +#define MAX_LIGHTS 4 +#define LIGHT_DIRECTIONAL 0 +#define LIGHT_POINT 1 struct MaterialProperty { vec3 color; @@ -112,7 +110,7 @@ void main() if (lights[i].enabled == 1) { vec3 light = vec3(0.0); - + if (lights[i].type == LIGHT_DIRECTIONAL) light = -normalize(lights[i].target - lights[i].position); if (lights[i].type == LIGHT_POINT) light = normalize(lights[i].position - fragPosition); @@ -120,7 +118,7 @@ void main() lightDot += lights[i].color.rgb*NdotL; float specCo = 0.0; - if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewD, reflect(-(light), normal))), 16.0); // 16 refers to shine + if (NdotL > 0.0) specCo = pow(max(0.0, dot(viewD, reflect(-(light), normal))), 16.0); specular += specCo; } } |
