intial changes for commit #495

This commit is contained in:
Xonk
2024-11-15 17:54:18 -05:00
parent b32041d4fc
commit b93d6f1a12
56 changed files with 3550 additions and 2274 deletions

View File

@ -14,7 +14,7 @@ flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
#ifdef OVERWORLD_SHADER
#if defined Daily_Weather
#ifdef Daily_Weather
flat varying vec4 dailyWeatherParams0;
flat varying vec4 dailyWeatherParams1;
#endif
@ -56,11 +56,26 @@ vec4 toClipSpace3(vec3 viewSpacePosition) {
}
void main() {
gl_Position = ftransform();
gl_Position = dhProjection * gl_ModelViewMatrix * gl_Vertex;
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;
@ -68,13 +83,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);
@ -83,7 +98,6 @@ void main() {
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;