Merlin1809
2026-01-21 20:35:24 +01:00
parent 0751717187
commit 841ab089d7
6 changed files with 28 additions and 27 deletions
+18 -9
View File
@@ -277,30 +277,39 @@ void main() {
vec2 edgeBlend = eastHeightMult*vec2(-0.17,0.0) + westHeightMult*vec2(0.17,0.0) + southHeightMult*vec2(0.0,-0.17) + northHeightMult*vec2(0.0,0.17);
vec3 worldUp = vec3(0.0, 1.0, 0.0);
vec3 offsetPos = vertex+vec3(0.0, 1.0, 0.0)+relativeEyePosition;
vec3 offsetPos = vertex + worldUp + relativeEyePosition;
float playerDist = smoothstep(0.5, 0.05, length(offsetPos.xz)) * smoothstep(1.0, 0.2, abs(offsetPos.y));
vec2 dir2 = normalize(vertex.xz+relativeEyePosition.xz);
vec2 dir2 = normalize(vertex.xz + relativeEyePosition.xz);
vec2 Wvertex = vertex.xz+cameraPositionFract.xz+mod(vec2(cameraPositionInt.xz), vec2(20.0));
vec2 Wvertex = vertex.xz + cameraPositionFract.xz + mod(vec2(cameraPositionInt.xz), vec2(20.0));
vec2 randomDir = 2.0*(texture(noisetex, 0.75*Wvertex).xy+texture(noisetex, 0.35*Wvertex.yx).xy)-1.0;
vec2 randomDir = 2.0 * (texture(noisetex, 0.75*Wvertex).xy + texture(noisetex, 0.35*Wvertex.yx).xy) - 1.0;
// vertex.xz -= 0.05*randomDir;
vec3 dir = normalize(vertex);
vec3 originalVertex = vertex;
vec3 worldUp = vec3(0.0, 1.0, 0.0);
vec3 right = GRASS_BASE_THICKNESS*normalize(cross(worldUp, dir));
worldUp *= heightMult;
originalVertex -= right*0.125*GRASS_BASE_THICKNESS;
vec3 verticies[21];
float grassHeights[21];
vec3 GrassNormal[7];
#if GRASS_QUALITY == 2
vec3 verticies[21];
float grassHeights[21];
vec3 GrassNormal[7];
#elif GRASS_QUALITY == 1
vec3 verticies[15];
float grassHeights[15];
vec3 GrassNormal[5];
#else
vec3 verticies[9];
float grassHeights[9];
vec3 GrassNormal[3];
#endif
for (j = 0; j < triangle_count; j++) {
+7 -7
View File
@@ -801,11 +801,11 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
#ifdef PIXELATED_WAVES
#if WATER_SIM_SCALE == 0
float NORMAL_SCALE = 20.0;
const float NORMAL_SCALE = 20.0;
#elif WATER_SIM_SCALE == 1
float NORMAL_SCALE = 40.0;
const float NORMAL_SCALE = 40.0;
#else
float NORMAL_SCALE = 80.0;
const float NORMAL_SCALE = 80.0;
#endif
ivec2 normalSize = imageSize(waveSim2);
@@ -816,13 +816,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
vec4 waves = imageLoad(waveSim2, ivec2(centeredUV));
#else
#if WATER_SIM_DISTANCE == 1
float NORMAL_SCALE = 0.04;
const float NORMAL_SCALE = 0.04;
#elif WATER_SIM_DISTANCE == 2
float NORMAL_SCALE = 0.02;
const float NORMAL_SCALE = 0.02;
#elif WATER_SIM_DISTANCE == 3
float NORMAL_SCALE = 0.015;
const float NORMAL_SCALE = 0.015;
#else
float NORMAL_SCALE = 0.01;
const float NORMAL_SCALE = 0.01;
#endif
vec2 waveUV = (worldPos.xz - previousCameraPositionWave2.xz) * NORMAL_SCALE;
+1 -1
View File
@@ -146,7 +146,7 @@ float doVignette( in vec2 texcoord, in float noise){
}
#if DEBUG_VIEW == debug_WATERSIM && WATER_INTERACTION == 2
layout (rgba16f) uniform image2D waveSim2;
layout (rgba16f) uniform readonly image2D waveSim2;
#endif
+1 -1
View File
@@ -38,7 +38,7 @@ layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
layout (rg16f) uniform image2D waveSim;
layout (rgba16f) uniform image2D waveSim2;
layout (rgba16f) uniform readonly image2D waveSim2;
const ivec2 resolution = ivec2(workGroups.x * 32, workGroups.y * 32);
+1 -1
View File
@@ -37,7 +37,7 @@ layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
#endif
layout (rg16f) uniform image2D waveSim;
layout (rg16f) uniform readonly image2D waveSim;
layout (rgba16f) uniform image2D waveSim2;
const ivec2 resolution = ivec2(workGroups.x * 32, workGroups.y * 32);
-8
View File
@@ -1,8 +0,0 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define ENTITIES
#include "/dimensions/all_solid.gsh"