4082k / fog poistettu

This commit is contained in:
Teemu Järvisalo
2025-08-01 15:50:23 +03:00
parent b62df3ff88
commit bd8c146348

View File

@ -245,6 +245,7 @@ vec3 applyFog(vec3 col, float t, vec3 rd, vec3 lightDir, float fogAmount) {
} }
*/ */
/*
vec3 shading(vec3 p, vec3 n, vec3 dir, vec3 caPos) { vec3 shading(vec3 p, vec3 n, vec3 dir, vec3 caPos) {
vec3 outMaterial = vec3(0.0); vec3 outMaterial = vec3(0.0);
@ -254,7 +255,7 @@ vec3 shading(vec3 p, vec3 n, vec3 dir, vec3 caPos) {
//lights += phongLighting(p, n, camPos, dir, vec3(0.51), outMaterial); //lights += phongLighting(p, n, camPos, dir, vec3(0.51), outMaterial);
lights += addPointLight(vec3(0., 20.0, 0.), vec3(0.7, 0.3, 0.7), 15.0, p, dir, n); lights += addPointLight(vec3(0., 20.0, 0.), vec3(0.7, 0.3, 0.7), 15.0, p, dir, n);
/*
// LIGHT CHANGING WITH CIRCLE RADIUS // LIGHT CHANGING WITH CIRCLE RADIUS
float maxRadius = 25.; // Circle radius float maxRadius = 25.; // Circle radius
float particleHeight = 15.; //(syncs[5] * 40.); float particleHeight = 15.; //(syncs[5] * 40.);
@ -276,18 +277,18 @@ vec3 shading(vec3 p, vec3 n, vec3 dir, vec3 caPos) {
//res = opU(res, vec2(sdSphere(p - objPos, sphereRadius), 1.)); //res = opU(res, vec2(sdSphere(p - objPos, sphereRadius), 1.));
lights += addPointLight(objPos, vec3(0.33, 0.91, 0.93), 30.0, p, dir, n); lights += addPointLight(objPos, vec3(0.33, 0.91, 0.93), 30.0, p, dir, n);
*/
/*
vec3 lightDir = vec3(0., 2., 3); vec3 lightDir = vec3(0., 2., 3);
float ind = cl(dot(n, no(lightDir * vec3(.0, 1.0, -2.0))), 0.0, 1.0); float ind = cl(dot(n, no(lightDir * vec3(.0, 1.0, -2.0))), 0.0, 1.0);
lights += vec3(0.6, 0.6, 0.6) * ind * 0.4; lights += vec3(0.6, 0.6, 0.6) * ind * 0.4;
*/
outMaterial *= max(vec3(0.), lights); // output with lights; outMaterial *= max(vec3(0.), lights); // output with lights;
return outMaterial; return outMaterial;
} }
*/
/*
vec3 postProcess(vec3 col) { vec3 postProcess(vec3 col) {
// Contrast // Contrast
float contrast = 0.85; float contrast = 0.85;
@ -308,6 +309,7 @@ vec3 postProcess(vec3 col) {
return col; return col;
} }
*/
////////////////// //////////////////
// RENDERING // // RENDERING //
@ -364,6 +366,10 @@ vec3 render(vec2 uv) {
void main() { void main() {
vec3 finalColor = render(getUV()); vec3 finalColor = render(getUV());
finalColor = postProcess(finalColor); //finalColor = postProcess(finalColor);
finalColor = mix(finalColor, smoothstep(0.0, 1.0, finalColor), 0.8); // contrast
finalColor = pow(finalColor, vec3(.6)); // gamma 2.2
o = vec4(finalColor, 1.); o = vec4(finalColor, 1.);
} }