fix end and nether failures

This commit is contained in:
Xonk 2023-06-23 13:03:58 -04:00
parent c68a5fdd7b
commit 906d5ae9a6
9 changed files with 24 additions and 3 deletions

View File

@ -151,6 +151,7 @@ vec3 viewToWorld(vec3 viewPosition) {
#include "lib/waterBump.glsl"
#include "lib/specular.glsl"
#define OVERWORLD
#include "lib/diffuse_lighting.glsl"
float lengthVec (vec3 vec){

View File

@ -33,6 +33,7 @@ uniform vec3 cameraPosition;
#include "lib/sky_gradient.glsl"
#include "lib/volumetricClouds.glsl"
#define OVERWORLD
#include "lib/diffuse_lighting.glsl"
//faster and actually more precise than pow 2.2

View File

@ -69,6 +69,8 @@ flat varying vec3 avgAmbient;
#include "lib/clouds.glsl"
#include "lib/stars.glsl"
#include "lib/volumetricClouds.glsl"
#define OVERWORLD
#include "lib/diffuse_lighting.glsl"

View File

@ -1,7 +1,11 @@
// in this here file im doing all the lighting for sunlight, ambient light, torches, for solids and translucents.
//// OVERWORLD ////
#ifndef OVERWORLD
uniform float lightningFlash;
#endif
//// OVERWORLD ////
#ifdef OVERWORLD
vec3 DoAmbientLighting (vec3 SkyColor, vec3 TorchColor, vec2 Lightmap, float skyLightDir){
// Lightmap.x = 0.0;
// Lightmap.y = 1.0;
@ -41,8 +45,9 @@ vec3 DoDirectLighting(vec3 SunColor, float Shadow, float NdotL, float Subsurface
return SunLight;
}
#endif
#ifdef NETHER
//// NETHER ////
vec3 DoAmbientLighting_Nether(vec3 FogColor, vec3 TorchColor, float Lightmap, vec3 Normal, vec3 np3, vec3 WorldPos){
@ -59,6 +64,9 @@ vec3 DoAmbientLighting_Nether(vec3 FogColor, vec3 TorchColor, float Lightmap, ve
return AmbientLight + TorchLight + LavaGlow;
}
#endif
#ifdef END
//// END ////
vec3 DoAmbientLighting_End(vec3 FogColor, vec3 TorchColor, float Lightmap, vec3 Normal, vec3 np3){
@ -73,4 +81,5 @@ vec3 DoAmbientLighting_End(vec3 FogColor, vec3 TorchColor, float Lightmap, vec3
vec3 AmbientLight = vec3(0.5,0.75,1.0) * 0.05 + FogColor*clamp(1.1 + dot(Normal,np3),0.0,1.0)*0.5;
return TorchLight + AmbientLight;
}
}
#endif

View File

@ -27,6 +27,8 @@ uniform vec3 cameraPosition;
#include "/lib/settings.glsl"
#define END
#define NETHER
#include "/lib/diffuse_lighting.glsl"
vec3 toLinear(vec3 sRGB){

View File

@ -57,6 +57,8 @@ flat varying vec3 avgAmbient;
#include "/lib/sky_gradient.glsl"
#include "/lib/waterBump.glsl"
#define END
#define NETHER
#include "/lib/diffuse_lighting.glsl"

View File

@ -2,6 +2,8 @@
#extension GL_EXT_gpu_shader4 : enable
#include "/lib/settings.glsl"
#define NETHER
#include "/lib/diffuse_lighting.glsl"

View File

@ -2,6 +2,8 @@
#extension GL_EXT_gpu_shader4 : enable
#include "/lib/settings.glsl"
#define END
#include "/lib/diffuse_lighting.glsl"