| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- precision highp float;
- // Constants
- uniform vec3 vEyePosition;
- uniform float alpha;
- uniform vec3 shadowColor;
- // Input
- varying vec3 vPositionW;
- #ifdef NORMAL
- varying vec3 vNormalW;
- #endif
- // Helper functions
- #include<helperFunctions>
- // Lights
- #include<__decl__lightFragment>[0..maxSimultaneousLights]
- #include<lightsFragmentFunctions>
- #include<shadowsFragmentFunctions>
- #include<clipPlaneFragmentDeclaration>
- // Fog
- #include<fogFragmentDeclaration>
- void main(void) {
- #include<clipPlaneFragment>
- vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
- // Normal
- #ifdef NORMAL
- vec3 normalW = normalize(vNormalW);
- #else
- vec3 normalW = vec3(1.0, 1.0, 1.0);
- #endif
- // Lighting
- vec3 diffuseBase = vec3(0., 0., 0.);
- lightingInfo info;
- float shadow = 1.;
- float glossiness = 0.;
-
- #include<lightFragment>[0..1]
- // Composition
- vec4 color = vec4(shadowColor, (1.0 - clamp(shadow, 0., 1.)) * alpha);
- #include<fogFragment>
- gl_FragColor = color;
- }
|