re-add lighting

This commit is contained in:
James Seibel
2026-02-28 12:13:34 -06:00
parent 3f509be195
commit 200e089a33
4 changed files with 10 additions and 40 deletions
@@ -19,15 +19,15 @@
package com.seibel.distanthorizons.core.wrapperInterfaces.render;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam;
import com.seibel.distanthorizons.api.objects.math.DhApiVec3f;
import com.seibel.distanthorizons.core.render.renderer.RenderParams;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IProfilerWrapper;
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
public interface IMcLodRenderer extends IBindable
{
void render(
DhApiRenderParam renderEventParam, boolean opaquePass,
RenderParams renderEventParam, boolean opaquePass,
DhApiVec3f modelPos, IVertexBufferWrapper[] bufferList,
IProfilerWrapper profiler);
@@ -1,24 +0,0 @@
#version 150 core
in vec2 TexCoord;
in vec4 fColor;
out vec4 fragColor;
uniform sampler2D uDhDepthTexture;
// DH fade frag test
void main()
{
float dhFragmentDepth = texture(uDhDepthTexture, TexCoord).r;
if (dhFragmentDepth == 1)
{
// no MC depth
fragColor = fColor;
}
else
{
// MC depth drawn
fragColor = vec4(1, 1, 1, 1); // white
}
}
@@ -2,7 +2,7 @@
in vec4 vertexColor;
in vec3 vertexWorldPos;
in vec4 vPos;
in vec3 vPos;
in vec4 gl_FragCoord;
out vec4 fragColor;
@@ -1,9 +1,12 @@
#version 150
in uvec4 vPosition;
in uvec3 vPosition;
in uint meta; // contains light and micro-offset data
in vec4 vColor;
in int irisMaterial;
in int irisNormal;
out vec4 vPos;
out vec3 vPos;
out vec4 vertexColor;
out vec3 vertexWorldPos;
out float vertexYPos;
@@ -24,14 +27,7 @@ layout (std140) uniform vertUniformBlock
uniform sampler2D uLightMap;
/**
* Vertex Shader
*
* author: James Seibel
* author: TomTheFurry
* author: stduhpf
* updated: coolGi
*
* version: 2025-12-22
* LOD terrain Vertex Shader
*/
void main()
{
@@ -41,8 +37,6 @@ void main()
vertexYPos = vPosition.y + uWorldYOffset;
uint meta = vPosition.a;
uint mirco = (meta & 0xFF00u) >> 8u; // mirco offset which is a xyz 2bit value
// 0b00 = no offset
// 0b01 = positive offset
@@ -72,7 +66,7 @@ void main()
uint lights = meta & 0xFFu;
float skyLight = (float(lights/16u)+0.5) / 16.0;
float blockLight = (mod(float(lights), 16.0)+0.5) / 16.0;
vertexColor = vec4(1.0); //vec4(texture(uLightMap, vec2(skyLight, blockLight)).xyz, 1.0);
vertexColor = vec4(texture(uLightMap, vec2(skyLight, blockLight)).xyz, 1.0);
if (!uIsWhiteWorld)
{