minecraft-renderer 0.1.76 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mesherWasm.js +23 -1
- package/dist/minecraft-renderer.js +85 -60
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +420 -395
- package/package.json +1 -1
- package/src/lib/createPlayerObject.test.ts +46 -0
- package/src/lib/createPlayerObject.ts +27 -2
- package/src/three/chunkMeshManager.ts +8 -1
- package/src/three/shaders/cubeBlockShader.ts +36 -1
- package/src/three/worldRendererThree.ts +6 -0
- package/src/wasm-mesher/tests/shaderCubeInstances.test.ts +12 -1
package/dist/mesherWasm.js
CHANGED
|
@@ -3905,6 +3905,8 @@ uniform float u_skyLevel;
|
|
|
3905
3905
|
uniform float u_lightCurve;
|
|
3906
3906
|
uniform float u_minBrightness;
|
|
3907
3907
|
uniform float u_lightGamma;
|
|
3908
|
+
uniform float u_shadingTheme; // 0 = vanilla, 1 = high-contrast
|
|
3909
|
+
uniform float u_cardinalLight; // 0 = default, 1 = nether
|
|
3908
3910
|
|
|
3909
3911
|
in float v_blockLight;
|
|
3910
3912
|
in float v_skyLight;
|
|
@@ -3954,6 +3956,24 @@ void applyFog() {
|
|
|
3954
3956
|
|
|
3955
3957
|
${wQ}
|
|
3956
3958
|
|
|
3959
|
+
const vec3 FACE_NORMAL[6] = vec3[6](
|
|
3960
|
+
vec3(0.0, 1.0, 0.0), // UP
|
|
3961
|
+
vec3(0.0,-1.0, 0.0), // DOWN
|
|
3962
|
+
vec3(1.0, 0.0, 0.0), // EAST
|
|
3963
|
+
vec3(-1.0,0.0, 0.0), // WEST
|
|
3964
|
+
vec3(0.0, 0.0, 1.0), // SOUTH
|
|
3965
|
+
vec3(0.0, 0.0,-1.0) // NORTH
|
|
3966
|
+
);
|
|
3967
|
+
|
|
3968
|
+
float sideShadingFromFaceId(int faceId, float theme, float cardinal) {
|
|
3969
|
+
vec3 n = FACE_NORMAL[faceId];
|
|
3970
|
+
float hc = 0.8 + 0.5 * max(0.0, 0.66*n.x + 0.66*n.y + 0.33*n.z);
|
|
3971
|
+
float nether = 0.5 + abs(0.1*n.x + 0.4*n.y + 0.3*n.z);
|
|
3972
|
+
float vanilla = 0.75 + 0.25*n.y + 0.05*(abs(n.z) - 3.0*abs(n.x));
|
|
3973
|
+
float nonHc = mix(vanilla, nether, cardinal);
|
|
3974
|
+
return mix(nonHc, hc, theme);
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3957
3977
|
void main() {
|
|
3958
3978
|
// Atlas sample (pixelated, no filtering)
|
|
3959
3979
|
ivec2 atlasSize = textureSize(u_atlas, 0);
|
|
@@ -4000,7 +4020,9 @@ void main() {
|
|
|
4000
4020
|
|
|
4001
4021
|
float L = max(v_blockLight, min(v_skyLight, u_skyLevel));
|
|
4002
4022
|
float Lm = applyLightmap(L);
|
|
4003
|
-
float
|
|
4023
|
+
float aoFactor = mix(0.8 * v_ao + 0.2, v_ao, u_shadingTheme);
|
|
4024
|
+
float side = sideShadingFromFaceId(v_faceId, u_shadingTheme, u_cardinalLight);
|
|
4025
|
+
float brightness = Lm * aoFactor * side;
|
|
4004
4026
|
|
|
4005
4027
|
// Opaque full cubes: always alpha 1 (legacy uses cutout material; avoids seeing blocks behind)
|
|
4006
4028
|
FragColor = vec4(baseColor.rgb * tint * brightness, 1.0);
|