tweaks to subsurface scattering, improve SSS in the distance. make screenspace shadows have consistent step length across all window resolutions. tweak torch lighting (make it slightly brighter and a warmer color). tweak TAA handling of the hand. tweak specular reflection handling of the hand to be slightly more stable. make the shader use moonPosition instead of inverted sunPosition for moon related code. add support for Caelium moon positions. improve water parallax. remove some unused code improve specular handling of translucent entities with inside faces (slimes). add settings for refraction effects. re-enable block breaking effect and glass tint (it was off accidentally lol)

This commit is contained in:
Xonk
2025-01-28 23:19:33 -05:00
parent 6c41c008c0
commit a58cdfb9e9
24 changed files with 298 additions and 949 deletions

View File

@ -54,15 +54,19 @@ float getWaterHeightmap(vec2 posxz) {
return (heightSum / 60.0) * WavesLarge;
}
vec3 getWaveNormal(vec3 posxz, bool isLOD){
vec3 getWaveNormal(vec3 waterPos, vec3 playerpos, bool isLOD){
// vary the normal's "smooth" factor as distance changes, to avoid noise from too much details.
// float range = pow(clamp(1.0 - length(posxz - cameraPosition)/(32*4),0.0,1.0),2.0);
// float deltaPos = mix(0.5, 0.1, range);
float range = min(length(posxz - cameraPosition) / (16*14.0), 3.0);
float range = min(length(playerpos) / (16*12.0), 3.0) ;
float deltaPos = range + 0.15;
// float range = 1-max(1.0-length(playerpos) / (16.0*16.0) ,0.0) ;
// range = (1.0-pow(1.0-pow(range,2.0),2.0)) * 3.0;
// float deltaPos = range + 0.15;
// float normalMult = 1.0 * WATER_WAVE_STRENGTH;
// if(isLOD){
@ -75,7 +79,7 @@ vec3 getWaveNormal(vec3 posxz, bool isLOD){
deltaPos = 0.025;
#endif
vec2 coord = posxz.xz;
vec2 coord = waterPos.xy;
float h0 = getWaterHeightmap(coord);
float h1 = getWaterHeightmap(coord + vec2(deltaPos,0.0));