Improve shaders formatting

7344-support-launching-the-example-suite
Andrei Kortunov 2 years ago
parent 629300eee8
commit 1be1f72f6c

@ -27,5 +27,4 @@ void main()
vec3 colorOut = useNormalAsColor? gl_Normal.xyz : color;
passColor = vec4(colorOut, 1.);
}
}

@ -27,7 +27,6 @@ void main()
texture2D(imageIn, uv + vec2(0.0, -oneAndHalfOffset)).r
);
vec4 color = texture2D(imageIn, uv);
gl_FragColor = applySprings(color, n, n2);

@ -35,7 +35,6 @@ float unshadowedLightRatio(float distance)
{
shadowing = min(shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r, shadowing);
doneShadows = all(lessThan(shadowXYZ, vec3(0.95, 0.95, 1.0))) && all(greaterThan(shadowXYZ, vec3(0.05, 0.05, 0.0)));
#if @perspectiveShadowMaps
doneShadows = doneShadows && all(lessThan(shadowRegionXYZ, vec3(1.0, 1.0, 1.0))) && all(greaterThan(shadowRegionXYZ.xy, vec2(-1.0, -1.0)));

@ -79,7 +79,8 @@ void main()
paintSun(color);
else if (pass == PASS_SUNGLARE)
paintSunglare(color);
else if (pass == PASS_SUNFLASH_QUERY) {
else if (pass == PASS_SUNFLASH_QUERY)
{
processSunflashQuery();
return;
}

@ -35,7 +35,8 @@ float calcSoftParticleFade(
const float nearMult = 300.0;
float viewBias = 1.0;
if (fade) {
if (fade)
{
float VdotN = dot(viewDir, viewNormal);
viewBias = abs(VdotN) * quickstep(euclidianDepth / nearMult) * (1.0 - pow(1.0 + VdotN, 1.3));
}

@ -1,19 +1,21 @@
#ifndef LIB_WATER_FRESNEL
#define LIB_WATER_FRESNEL
float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta)
float fresnel_dielectric(vec3 incoming, vec3 normal, float eta)
{
float c = abs(dot(Incoming, Normal));
float c = abs(dot(incoming, normal));
float g = eta * eta - 1.0 + c * c;
float result;
if (g > 0.0) {
if (g > 0.0)
{
g = sqrt(g);
float A =(g - c)/(g + c);
float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
result = 0.5 * A * A *(1.0 + B * B);
}
else {
else
{
result = 1.0; /* TIR (no refracted component) */
}

Loading…
Cancel
Save