|
|
@@ -15,7 +15,7 @@
|
|
|
vec3 getNormalFromTexture(in vec3 normal, in vec3 tangent, in float tangentW,
|
|
|
in sampler2D map, in vec2 texCoords)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
vec3 n = normalize(normal);
|
|
|
vec3 t = normalize(tangent);
|
|
|
vec3 b = cross(n, t) * tangentW;
|
|
|
@@ -37,7 +37,7 @@ vec3 getNormalFromTexture(in vec3 normal, in vec3 tangent, in float tangentW,
|
|
|
/// Just normalize
|
|
|
vec3 getNormalSimple(in vec3 normal)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
return normalize(normal);
|
|
|
#else
|
|
|
return vec3(0.0);
|
|
|
@@ -56,7 +56,7 @@ vec3 getNormalSimple(in vec3 normal)
|
|
|
vec3 getEnvironmentColor(in vec3 vertPosViewSpace, in vec3 normal,
|
|
|
in sampler2D map)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
// In case of normal mapping I could play with vertex's normal but this
|
|
|
// gives better results and its allready computed
|
|
|
|
|
|
@@ -88,7 +88,7 @@ vec3 getDiffuseColorAndDoAlphaTesting(
|
|
|
in vec2 texCoords,
|
|
|
in float tolerance)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
vec4 col = texture2D(map, texCoords);
|
|
|
if(col.a < tolerance)
|
|
|
{
|
|
|
@@ -112,7 +112,7 @@ vec3 getDiffuseColorAndDoAlphaTesting(
|
|
|
/// Just read the RGB color from texture
|
|
|
vec3 readColor3FromTexture(in sampler2D tex, in vec2 texCoords)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
return texture2D(tex, texCoords).rgb;
|
|
|
#else
|
|
|
return vec3(0.0);
|
|
|
@@ -127,7 +127,7 @@ vec3 readColor3FromTexture(in sampler2D tex, in vec2 texCoords)
|
|
|
void writeFais(in vec3 diffCol, in vec3 normal, in vec3 specularCol,
|
|
|
in float shininess, in float blurring)
|
|
|
{
|
|
|
-#if !defined(DEPTH_PASS)
|
|
|
+#if defined(COLOR_PASS)
|
|
|
fMsNormalFai = vec3(packNormal(normal), blurring);
|
|
|
fMsDiffuseFai = diffCol;
|
|
|
fMsSpecularFai = vec4(specularCol, shininess / MAX_SHININESS);
|