surprise commit

new stuff

reworked clouds, general lighting, end and nether shaders still WIP

lighting is more balanced in general.
This commit is contained in:
Xonk
2023-04-16 16:18:26 -04:00
parent 7fc3d17c05
commit 2ee6634935
223 changed files with 8807 additions and 16872 deletions

View File

@ -16,7 +16,6 @@ varying vec4 color;
varying vec4 normalMat;
varying vec3 binormal;
varying vec3 tangent;
varying float dist;
uniform mat4 gbufferModelViewInverse;
varying vec3 viewVector;
@ -26,6 +25,7 @@ attribute vec4 at_tangent;
attribute vec4 mc_Entity;
uniform sampler2D colortex4;
uniform vec3 sunPosition;
flat varying vec3 WsunVec;
uniform float sunElevation;
@ -33,7 +33,7 @@ uniform float sunElevation;
varying vec4 tangent_other;
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
flat varying vec3 avgAmbient;
uniform vec2 texelSize;
@ -51,6 +51,17 @@ uniform int framemod8;
vec4 toClipSpace3(vec3 viewSpacePosition) {
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z);
}
#define PHYSICSMOD_VERTEX
#include "/lib/oceans.glsl"
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@ -58,25 +69,42 @@ vec4 toClipSpace3(vec3 viewSpacePosition) {
//////////////////////////////VOID MAIN//////////////////////////////
void main() {
vec4 Swtich_gl_vertex = gl_Vertex;
if(physics_iterationsNormal > 0.0){
// basic texture to determine how shallow/far away from the shore the water is
physics_localWaviness = texelFetch(physics_waviness, ivec2(gl_Vertex.xz) - physics_textureOffset, 0).r;
// transform gl_Vertex (since it is the raw mesh, i.e. not transformed yet)
vec4 finalPosition = vec4(gl_Vertex.x, gl_Vertex.y + physics_waveHeight(gl_Vertex.xz, PHYSICS_ITERATIONS_OFFSET, physics_localWaviness, physics_gameTime), gl_Vertex.z, gl_Vertex.w);
// pass this to the fragment shader to fetch the texture there for per fragment normals
physics_localPosition = finalPosition.xyz;
Swtich_gl_vertex.xyz = finalPosition.xyz ;
}
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
lmtexcoord.zw = lmcoord;
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
gl_Position = toClipSpace3(position);
vec3 position = mat3(gl_ModelViewMatrix) * vec3(Swtich_gl_vertex) + gl_ModelViewMatrix[3].xyz;
gl_Position = toClipSpace3(position);
color = gl_Color;
float mat = 0.0;
if(mc_Entity.x == 8.0 || mc_Entity.x == 9.0) {
mat = 1.0;
gl_Position.z -= 1e-4;
}
if (mc_Entity.x == 10002) mat = 0.01;
if (mc_Entity.x == 10002) mat = 0.2;
if (mc_Entity.x == 72) mat = 0.5;
// if (mc_Entity.x == 8) mat = 0.1;
#ifdef ENTITIES
mat = 0.2;
#endif
normalMat = vec4(normalize( gl_NormalMatrix*gl_Normal),mat);
@ -91,9 +119,7 @@ void main() {
tangent.y, binormal.y, normalMat.y,
tangent.z, binormal.z, normalMat.z);
dist = length(gl_ModelViewMatrix * gl_Vertex);
viewVector = ( gl_ModelViewMatrix * gl_Vertex).xyz;
viewVector = ( gl_ModelViewMatrix * Swtich_gl_vertex).xyz;
viewVector = normalize(tbnMatrix * viewVector);
@ -112,4 +138,6 @@ void main() {
lightCol.rgb = sc;
WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) *sunPosition);
avgAmbient = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
}