Seperated out the projection matrix from vanilla terrain projection
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#line 1
|
||||
struct Frustum {
|
||||
vec4 planes[6];
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#line 1
|
||||
//TODO: FIXME: this isnt actually correct cause depending on the face (i think) it could be 1/64 th of a position off
|
||||
// but im going to assume that since we are dealing with huge render distances, this shouldent matter that much
|
||||
float extractFaceIndentation(uint faceData) {
|
||||
return float((faceData>>16)&63)/63;
|
||||
return float((faceData>>16)&63)/63f;
|
||||
}
|
||||
|
||||
vec4 extractFaceSizes(uint faceData) {
|
||||
return (vec4(faceData&0xF, (faceData>>4)&0xF, (faceData>>8)&0xF, (faceData>>12)&0xF)/16)+vec4(0,1f/16,0,1f/16);
|
||||
return (vec4(faceData&0xF, (faceData>>4)&0xF, (faceData>>8)&0xF, (faceData>>12)&0xF)/16f)+vec4(0f,1f/16f,0f,1f/16f);
|
||||
}
|
||||
|
||||
uint faceHasAlphaCuttout(uint faceData) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#line 1
|
||||
#ifdef GL_ARB_gpu_shader_int64
|
||||
#define Quad uint64_t
|
||||
|
||||
|
||||
@@ -23,18 +23,18 @@ ivec3 extractRelativeLodPos() {
|
||||
}
|
||||
|
||||
vec4 uint2vec4RGBA(uint colour) {
|
||||
return vec4((uvec4(colour)>>uvec4(24,16,8,0))&uvec4(0xFF))/255;
|
||||
return vec4((uvec4(colour)>>uvec4(24,16,8,0))&uvec4(0xFF))/255f;
|
||||
}
|
||||
|
||||
//Gets the face offset with respect to the face direction (e.g. some will be + some will be -)
|
||||
float getDepthOffset(uint faceData, uint face) {
|
||||
float offset = extractFaceIndentation(faceData);
|
||||
return offset * (1-((int(face)&1)*2));
|
||||
return offset * (1f-((int(face)&1)*2f));
|
||||
}
|
||||
|
||||
vec2 getFaceSizeOffset(uint faceData, uint corner) {
|
||||
vec4 faceOffsetsSizes = extractFaceSizes(faceData);
|
||||
return mix(faceOffsetsSizes.xz, -(1-faceOffsetsSizes.yw), bvec2(((corner>>1)&1)==1, (corner&1)==1));
|
||||
return mix(faceOffsetsSizes.xz, -(1f-faceOffsetsSizes.yw), bvec2(((corner>>1)&1)==1, (corner&1)==1));
|
||||
}
|
||||
|
||||
//TODO: add a mechanism so that some quads can ignore backface culling
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#line 1
|
||||
uint extractDetail(SectionMeta section) {
|
||||
return section.posA>>28;
|
||||
}
|
||||
|
||||
@@ -3,4 +3,9 @@ accessWidener v1 named
|
||||
accessible field net/minecraft/client/texture/SpriteContents image Lnet/minecraft/client/texture/NativeImage;
|
||||
accessible field net/minecraft/client/render/Frustum frustumIntersection Lorg/joml/FrustumIntersection;
|
||||
accessible field net/minecraft/client/render/LightmapTextureManager texture Lnet/minecraft/client/texture/NativeImageBackedTexture;
|
||||
accessible field net/minecraft/client/color/block/BlockColors providers Lnet/minecraft/util/collection/IdList;
|
||||
accessible field net/minecraft/client/color/block/BlockColors providers Lnet/minecraft/util/collection/IdList;
|
||||
accessible field net/minecraft/client/render/GameRenderer zoomX F
|
||||
accessible field net/minecraft/client/render/GameRenderer zoomY F
|
||||
accessible field net/minecraft/client/render/GameRenderer zoom F
|
||||
|
||||
accessible method net/minecraft/client/render/GameRenderer getFov (Lnet/minecraft/client/render/Camera;FZ)D
|
||||
@@ -7,7 +7,6 @@
|
||||
"minecraft.MixinBackgroundRenderer",
|
||||
"minecraft.MixinClientChunkManager",
|
||||
"minecraft.MixinDebugHud",
|
||||
"minecraft.MixinGameRenderer",
|
||||
"minecraft.MixinMinecraftClient",
|
||||
"minecraft.MixinWorldRenderer"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user