Debug log: (1/2)
* Game version: 0.2.5
* Ran for : 6 minutes, 30 seconds
* Current time: 2024-09-13 at 21:00:38.515505400+02:00[Europe/Amsterdam]
* Operating system: Windows 10 10.0
* Arch: amd64
* Java VM name: Java HotSpot(TM) 64-Bit Server VM
* Java runtime version: 21.0.4+8-LTS-274
* System user language: nl
* CPU model: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
* Save location free / total space: 549,98 GB / 930,703 GB
* Available processors: 4
* Native heap use: 19 MB
* Java heap use: 19 MB
* Max memory available: 3,967 GB
* RAM available: 15,863 GB
* getGLVersion:
Type: OpenGL
Version: 4:6:0
Vendor: Intel
Renderer: Intel(R) HD Graphics 530
* Prestart error logs:
[LWJGL] OpenGL debug message
ID: 0x0
Source: SHADER COMPILER
Type: OTHER
Severity: MEDIUM
Message: SHADER_ID_COMPILE other warning has been generated. GLSL compile warning(s) for shader 22, "": WARNING: 0:1: '' : #version directive missing
[LWJGL] OpenGL debug message
ID: 0x0
Source: SHADER COMPILER
Type: OTHER
Severity: MEDIUM
Message: SHADER_ID_COMPILE other warning has been generated. GLSL compile warning(s) for shader 23, "": WARNING: 0:5: '' : #version directive missing
[LWJGL] OpenGL debug message
ID: 0x0
Source: SHADER COMPILER
Type: OTHER
Severity: MEDIUM
Message: SHADER_ID_COMPILE other warning has been generated. GLSL compile warning(s) for shader 25, "": WARNING: 0:1: '' : #version directive missing
[LWJGL] OpenGL debug message
ID: 0x0
Source: SHADER COMPILER
Type: OTHER
Severity: MEDIUM
Message: SHADER_ID_COMPILE other warning has been generated. GLSL compile warning(s) for shader 26, "": WARNING: 0:5: '' : #version directive missing
* Exception logs:
java.lang.RuntimeException: Caused a manual crash, not a bug!
SHADERS:
* ChunkShader: chunk.vert.glsl, chunk.frag.glsl
VERTEX: #version 150
#ifndef chunk_vert_glsl
#define chunk_vert_glsl
//in vec3 a_position;
//in int a_uvAoPackedColorAttrib;
in vec4 a_lighting;
uniform vec3 u_batchPosition;
uniform mat4 u_projViewTrans;
uniform mat4 u_modelMat;
out vec2 v_texCoord0;
out vec3 worldPos;
out vec4 blocklight;
out vec3 faceNormal;
#ifndef common_bitUnpacker_glsl
#define common_bitUnpacker_glsl
#define GET_TEX_COORDS getTexCoordsFromUVIdx(int(a_uvIdx))
#define GET_VERT_NORMAL getVertNormalFromIdx(int(a_uvIdx))
#define GET_FACE_NORMAL getFaceNormalFromIdx(int(a_uvIdx))
#define GET_BLOCK_VERT_POSITION getBlockVertexPosition(int(a_uvIdx), int(a_positionPacked))
#define NUM_FLOATS_PER_FACE_UVTEXBUFF (2 + 3 + 3 + 3)
in float a_positionPacked;
in float a_uvIdx;
uniform samplerBuffer texBuffer;
vec2 getTexCoordsFromUVIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec2(texelFetch(texBuffer, i).r,
texelFetch(texBuffer, i+1).r);
}
vec3 getVertNormalFromIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec3(texelFetch(texBuffer, i+2).r,
texelFetch(texBuffer, i+3).r,
texelFetch(texBuffer, i+4).r);
}
vec3 getFaceNormalFromIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec3(texelFetch(texBuffer, i+5).r,
texelFetch(texBuffer, i+6).r,
texelFetch(texBuffer, i+7).r);
}
vec3 getBlockVertexPosition(int modelId, int packedPosition)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
vec3 offset = vec3(texelFetch(texBuffer, i+8).r,
texelFetch(texBuffer, i+9).r,
texelFetch(texBuffer, i+10).r);
int px = (packedPosition >> 12) & 0x3F;
int py = (packedPosition >> 6) & 0x3F;
int pz = (packedPosition) & 0x3F;
vec3 blockPos = vec3(float(px), float(py), float(pz));
return blockPos + offset;
}
int getUvAoBits(int uvAoPackedColor)
{
return (uvAoPackedColor >> 16) & 65535;
}
int getPackedColorBits(int uvAoPackedColor)
{
return uvAoPackedColor & 65535;
}
vec4 getBlockLight(int packedColorBits)
{
return vec4(((packedColorBits) & 15), (packedColorBits >> 4) & 15, (packedColorBits >> 8) & 15, (packedColorBits >> 12)) / 16.0;
}
#endif //common_bitUnpacker_glsl
void main()
{
worldPos = GET_BLOCK_VERT_POSITION + u_batchPosition;
//int packedColorBits = getPackedColorBits(a_uvAoPackedColorAttrib);
blocklight = a_lighting;//getBlockLight(packedColorBits);
//int uvAoBits = getUvAoBits(a_uvAoPackedColorAttrib);
v_texCoord0 = GET_TEX_COORDS;
faceNormal = GET_FACE_NORMAL;
gl_Position = (u_projViewTrans * u_modelMat * vec4(worldPos, 1.0));
}
#endif //chunk_vert_glsl
FRAG: #version 150
#ifndef chunk_frag_glsl
#define chunk_frag_glsl
#ifdef GL_ES
precision mediump float;
#endif
uniform vec3 skyAmbientColor;
uniform vec4 tintColor;
uniform vec3 worldAmbientColor;
in vec2 v_texCoord0;
in vec3 worldPos;
in vec4 blocklight;
in vec3 faceNormal;
uniform sampler2D texDiffuse;
uniform vec3 u_sunDirection;
out vec4 outColor;
void main()
{
vec2 tilingTexCoords = v_texCoord0;
vec4 texColor = texture(texDiffuse, v_texCoord0);
if(texColor.a == 0)
{
discard;
}
vec3 blockAmbientColor = skyAmbientColor * max(dot(u_sunDirection, faceNormal), 0.5);
// https://www.desmos.com/calculator
// y\ =\ \frac{30}{1+e^{-15\left(\frac{x}{25}\right)^{2}}}-15
vec3 it = pow(15*blocklight.rgb / 25.0, vec3(2));
vec3 t = 30.0/(1.0 + exp(-15.0 * it)) - 15;
vec3 lightTint = max(t/15, blocklight.a * blockAmbientColor);
//lightTint = max(lightTint, vec3(0.1));
//texColor = vec4(1);
outColor = tintColor * vec4(texColor.rgb * lightTint, texColor.a);
outColor.rgb = max(outColor.rgb, texColor.rgb * worldAmbientColor);
}
#endif //chunk_frag_glsl
* ChunkShader: chunk-water.vert.glsl, chunk-water.frag.glsl
VERTEX: #version 150
#ifndef chunk_water_vert_glsl
#define chunk_water_vert_glsl
//in vec3 a_position;
//in int a_uvAoPackedColorAttrib;
in vec4 a_lighting;
uniform vec3 u_batchPosition;
uniform mat4 u_projViewTrans;
uniform mat4 u_modelMat;
uniform float u_time;
uniform vec3 cameraPosition;
out vec2 v_texCoord0;
out vec4 blocklight;
out float waveStrength;
out vec3 worldPos;
out vec3 toCameraVector;
#ifndef common_bitUnpacker_glsl
#define common_bitUnpacker_glsl
#define GET_TEX_COORDS getTexCoordsFromUVIdx(int(a_uvIdx))
#define GET_VERT_NORMAL getVertNormalFromIdx(int(a_uvIdx))
#define GET_FACE_NORMAL getFaceNormalFromIdx(int(a_uvIdx))
#define GET_BLOCK_VERT_POSITION getBlockVertexPosition(int(a_uvIdx), int(a_positionPacked))
#define NUM_FLOATS_PER_FACE_UVTEXBUFF (2 + 3 + 3 + 3)
in float a_positionPacked;
in float a_uvIdx;
uniform samplerBuffer texBuffer;
vec2 getTexCoordsFromUVIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec2(texelFetch(texBuffer, i).r,
texelFetch(texBuffer, i+1).r);
}
vec3 getVertNormalFromIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec3(texelFetch(texBuffer, i+2).r,
texelFetch(texBuffer, i+3).r,
texelFetch(texBuffer, i+4).r);
}
vec3 getFaceNormalFromIdx(int modelId)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
return vec3(texelFetch(texBuffer, i+5).r,
texelFetch(texBuffer, i+6).r,
texelFetch(texBuffer, i+7).r);
}
vec3 getBlockVertexPosition(int modelId, int packedPosition)
{
int i = NUM_FLOATS_PER_FACE_UVTEXBUFF * modelId;
vec3 offset = vec3(texelFetch(texBuffer, i+8).r,
texelFetch(texBuffer, i+9).r,
texelFetch(texBuffer, i+10).r);
int px = (packedPosition >> 12) & 0x3F;
int py = (packedPosition >> 6) & 0x3F;
int pz = (packedPosition) & 0x3F;
vec3 blockPos = vec3(float(px), float(py), float(pz));
return blockPos + offset;
}
int getUvAoBits(int uvAoPackedColor)
{
return (uvAoPackedColor >> 16) & 65535;
}
int getPackedColorBits(int uvAoPackedColor)
{
return uvAoPackedColor & 65535;
}
vec4 getBlockLight(int packedColorBits)
{
return vec4(((packedColorBits) & 15), (packedColorBits >> 4) & 15, (packedColorBits >> 8) & 15, (packedColorBits >> 12)) / 16.0;
}
#endif //common_bitUnpacker_glsl
void main()
{
worldPos = GET_BLOCK_VERT_POSITION + u_batchPosition;
v_texCoord0 = GET_TEX_COORDS;
blocklight = a_lighting;
toCameraVector = cameraPosition - worldPos;
vec3 normal = GET_VERT_NORMAL;
float xOff = 0;
float zOff = 0;
if(normal.y < 0)
{
//waveStrength = 0.2;
xOff = normal.x * -0.001;
zOff = normal.z * -0.001;
}
//else
{
float waveSpeed = 0.25;
float waveTime = waveSpeed * u_time;
float scale = 5;
float wavePositionA = 10 * (cos(worldPos.x*scale) + sin(worldPos.z*scale));
float wavePositionB = 10 * (sin(worldPos.x*scale) + cos(worldPos.z*scale));
waveStrength = 0.1 * (sin(waveTime + wavePositionA) * cos(waveTime + wavePositionB));
}
gl_Position = u_projViewTrans * u_modelMat * vec4(worldPos.x + xOff, worldPos.y + waveStrength - 0.2, worldPos.z + zOff, 1.0);
}
#endif //chunk_water_vert_glsl
FRAG: #version 150
#ifndef chunk_water_frag_glsl
#define chunk_water_frag_glsl
#ifdef GL_ES
precision mediump float;
#endif
uniform float u_time;
uniform vec3 skyAmbientColor;
uniform vec3 skyColor;
uniform vec4 tintColor;
uniform vec3 worldAmbientColor;
in vec2 v_texCoord0;
in vec4 blocklight;
in float waveStrength;
in vec3 worldPos;
in vec3 toCameraVector;
uniform sampler2D texDiffuse;
uniform sampler2D noiseTex;
out vec4 outColor;
void main()
{
vec2 numTiles = floor(v_texCoord0);
vec2 tilingTexCoords = v_texCoord0;
if(numTiles.xy != vec2(0, 0))
{
tilingTexCoords = (v_texCoord0 - numTiles);
vec2 flooredTexCoords = floor((v_texCoord0 - numTiles) * 16) / 16;
numTiles = numTiles + vec2(1,1);
tilingTexCoords = flooredTexCoords + mod(((tilingTexCoords - flooredTexCoords) * numTiles) * 16, 1) / 16;
}
vec4 texColor = texture(texDiffuse, tilingTexCoords);
vec3 viewVector = normalize(toCameraVector);
vec3 faceNormal = vec3(0.0, 1.0, 0.0);
float fresnel = abs(dot(viewVector, faceNormal));
vec2 noiseUV = 0.2*vec2(waveStrength - 0.1) + worldPos.xz / 16.0;
noiseUV+=vec2(u_time*0.02);
vec2 distortion = fresnel * texture(noiseTex, noiseUV).rg;
vec3 waterColor = texColor.rgb;
fresnel = pow(fresnel, mix(3, 1, 2*(waveStrength - 0.1 + distortion.r/3.0)));
fresnel = pow(fresnel, 0.35);
waterColor = mix(waterColor * 0.5, waterColor, 0.5 + 0.5*waveStrength*(1-fresnel));```