Fix indentation (spaces -> tabs)
This commit is contained in:
parent
3654d34997
commit
dac91efeb1
|
@ -130,30 +130,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
|
||||||
|
|
||||||
#ifdef _LTC
|
#ifdef _LTC
|
||||||
#ifdef _ShadowMap
|
#ifdef _ShadowMap
|
||||||
if (receiveShadow) {
|
if (receiveShadow) {
|
||||||
#ifdef _SinglePoint
|
#ifdef _SinglePoint
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _Clusters
|
#ifdef _Clusters
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 1) {
|
else if (index == 1) {
|
||||||
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 2) {
|
else if (index == 2) {
|
||||||
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 3) {
|
else if (index == 3) {
|
||||||
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return direct;
|
return direct;
|
||||||
#endif
|
#endif
|
||||||
|
@ -166,30 +166,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
|
||||||
direct *= smoothstep(spotB, spotA, spotEffect);
|
direct *= smoothstep(spotB, spotA, spotEffect);
|
||||||
}
|
}
|
||||||
#ifdef _ShadowMap
|
#ifdef _ShadowMap
|
||||||
if (receiveShadow) {
|
if (receiveShadow) {
|
||||||
#ifdef _SinglePoint
|
#ifdef _SinglePoint
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _Clusters
|
#ifdef _Clusters
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 1) {
|
else if (index == 1) {
|
||||||
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 2) {
|
else if (index == 2) {
|
||||||
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 3) {
|
else if (index == 3) {
|
||||||
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return direct;
|
return direct;
|
||||||
}
|
}
|
||||||
|
@ -200,19 +200,19 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _ShadowMap
|
#ifdef _ShadowMap
|
||||||
if (receiveShadow) {
|
if (receiveShadow) {
|
||||||
#ifdef _SinglePoint
|
#ifdef _SinglePoint
|
||||||
#ifndef _Spot
|
#ifndef _Spot
|
||||||
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef _Clusters
|
#ifdef _Clusters
|
||||||
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
|
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
|
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
|
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return direct;
|
return direct;
|
||||||
|
|
|
@ -60,30 +60,30 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
|
||||||
direct *= smoothstep(spotB, spotA, spotEffect);
|
direct *= smoothstep(spotB, spotA, spotEffect);
|
||||||
}
|
}
|
||||||
#ifdef _ShadowMap
|
#ifdef _ShadowMap
|
||||||
if (receiveShadow) {
|
if (receiveShadow) {
|
||||||
#ifdef _SinglePoint
|
#ifdef _SinglePoint
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _Clusters
|
#ifdef _Clusters
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot0 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[0], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 1) {
|
else if (index == 1) {
|
||||||
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot1 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[1], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 2) {
|
else if (index == 2) {
|
||||||
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot2 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[2], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
else if (index == 3) {
|
else if (index == 3) {
|
||||||
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
vec4 lPos = LWVPSpot3 * vec4(p + n * bias * 10, 1.0);
|
||||||
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
direct *= shadowTest(shadowMapSpot[3], lPos.xyz / lPos.w, bias);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return direct;
|
return direct;
|
||||||
}
|
}
|
||||||
|
@ -91,17 +91,17 @@ vec3 sampleLight(const vec3 p, const vec3 n, const vec3 v, const float dotNV, co
|
||||||
|
|
||||||
#ifdef _ShadowMap
|
#ifdef _ShadowMap
|
||||||
#ifndef _Spot
|
#ifndef _Spot
|
||||||
if (receiveShadow) {
|
if (receiveShadow) {
|
||||||
#ifdef _SinglePoint
|
#ifdef _SinglePoint
|
||||||
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
||||||
#endif
|
#endif
|
||||||
#ifdef _Clusters
|
#ifdef _Clusters
|
||||||
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
if (index == 0) direct *= PCFCube(shadowMapPoint[0], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
|
else if (index == 1) direct *= PCFCube(shadowMapPoint[1], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
|
else if (index == 2) direct *= PCFCube(shadowMapPoint[2], ld, -l, bias, lightProj, n);
|
||||||
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
|
else if (index == 3) direct *= PCFCube(shadowMapPoint[3], ld, -l, bias, lightProj, n);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue