Revert "intial changes for commit #495"

This reverts commit 4869877f77.
This commit is contained in:
MikiP98
2024-11-16 21:39:26 +01:00
parent 51d696ea5f
commit 62be2ab097
56 changed files with 2279 additions and 3555 deletions

View File

@ -14,7 +14,7 @@ flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
#ifdef OVERWORLD_SHADER
#ifdef Daily_Weather
#if defined Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
@ -56,26 +56,11 @@ vec4 toClipSpace3(vec3 viewSpacePosition) {
}
void main() {
gl_Position = dhProjection * gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz;
// worldpos.y -= length(worldpos)/(16*2);
#ifdef PLANET_CURVATURE
float curvature = length(worldpos) / (16*8);
worldpos.y -= curvature*curvature * CURVATURE_AMOUNT;
#endif
position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz;
gl_Position = toClipSpace3(position);
pos = gl_ModelViewMatrix * gl_Vertex;
// vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
isWater = 0;
@ -83,13 +68,13 @@ void main() {
isWater = 1;
// offset water to not look like a full cube
// vec3 worldpos = mat3(gbufferModelViewInverse) * position;// + gbufferModelViewInverse[3].xyz ;
// worldpos.y -= 1.8/16.0;
// position = mat3(gbufferModelView) * worldpos;// + gbufferModelView[3].xyz;
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz ;
worldpos.y -= 1.8/16.0;
position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz;
}
// gl_Position = toClipSpace3(position);
gl_Position = toClipSpace3(position);
normals_and_materials = vec4(normalize(gl_Normal), 1.0);
@ -98,6 +83,7 @@ void main() {
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;