|
@@ -4,6 +4,8 @@
|
|
#extension GL_OES_standard_derivatives : enable
|
|
#extension GL_OES_standard_derivatives : enable
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_BEGIN
|
|
|
|
+
|
|
#ifdef LOGARITHMICDEPTH
|
|
#ifdef LOGARITHMICDEPTH
|
|
#extension GL_EXT_frag_depth : enable
|
|
#extension GL_EXT_frag_depth : enable
|
|
#endif
|
|
#endif
|
|
@@ -152,14 +154,23 @@ varying vec3 vDirectionW;
|
|
#include<logDepthDeclaration>
|
|
#include<logDepthDeclaration>
|
|
#include<fogFragmentDeclaration>
|
|
#include<fogFragmentDeclaration>
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
|
|
+
|
|
void main(void) {
|
|
void main(void) {
|
|
|
|
+
|
|
|
|
+#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
|
|
+
|
|
#include<clipPlaneFragment>
|
|
#include<clipPlaneFragment>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
|
|
vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
|
|
|
|
|
|
// Base color
|
|
// Base color
|
|
vec4 baseColor = vec4(1., 1., 1., 1.);
|
|
vec4 baseColor = vec4(1., 1., 1., 1.);
|
|
vec3 diffuseColor = vDiffuseColor.rgb;
|
|
vec3 diffuseColor = vDiffuseColor.rgb;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
// Alpha
|
|
// Alpha
|
|
float alpha = vDiffuseColor.a;
|
|
float alpha = vDiffuseColor.a;
|
|
@@ -188,16 +199,22 @@ void main(void) {
|
|
#ifdef ALPHAFROMDIFFUSE
|
|
#ifdef ALPHAFROMDIFFUSE
|
|
alpha *= baseColor.a;
|
|
alpha *= baseColor.a;
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
|
|
+ #define CUSTOM_FRAGMENT_UPDATE_ALPHA
|
|
|
|
|
|
baseColor.rgb *= vDiffuseInfos.y;
|
|
baseColor.rgb *= vDiffuseInfos.y;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
#include<depthPrePass>
|
|
#include<depthPrePass>
|
|
|
|
|
|
#ifdef VERTEXCOLOR
|
|
#ifdef VERTEXCOLOR
|
|
baseColor.rgb *= vColor.rgb;
|
|
baseColor.rgb *= vColor.rgb;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
|
|
|
|
+
|
|
// Ambient color
|
|
// Ambient color
|
|
vec3 baseAmbientColor = vec3(1., 1., 1.);
|
|
vec3 baseAmbientColor = vec3(1., 1., 1.);
|
|
|
|
|
|
@@ -205,6 +222,8 @@ void main(void) {
|
|
baseAmbientColor = texture2D(ambientSampler, vAmbientUV + uvOffset).rgb * vAmbientInfos.y;
|
|
baseAmbientColor = texture2D(ambientSampler, vAmbientUV + uvOffset).rgb * vAmbientInfos.y;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_BEFORE_LIGHTS
|
|
|
|
+
|
|
// Specular map
|
|
// Specular map
|
|
#ifdef SPECULARTERM
|
|
#ifdef SPECULARTERM
|
|
float glossiness = vSpecularColor.a;
|
|
float glossiness = vSpecularColor.a;
|
|
@@ -398,6 +417,8 @@ void main(void) {
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_BEFORE_FOG
|
|
|
|
+
|
|
#include<logDepthFragment>
|
|
#include<logDepthFragment>
|
|
#include<fogFragment>
|
|
#include<fogFragment>
|
|
|
|
|
|
@@ -417,5 +438,6 @@ void main(void) {
|
|
color.rgb *= color.a;
|
|
color.rgb *= color.a;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
|
|
gl_FragColor = color;
|
|
gl_FragColor = color;
|
|
-}
|
|
|
|
|
|
+}
|