Tinkering

This commit is contained in:
mcrcortex
2024-02-02 20:41:43 +10:00
parent ebe2fcc752
commit d051a9d990
4 changed files with 12 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = OcclusionCuller.class, remap = false)
public class MixinOcclusionCuller {
@Redirect(method = "isOutsideRenderDistance", at = @At(value = "INVOKE", target = "Ljava/lang/Math;abs(F)F"))
@Redirect(method = "isOutsideRenderDistance", at = @At(value = "INVOKE", target = "Ljava/lang/Math;abs(F)F"), require = 0)
private static float redirectAbs(float a) {
return 0;
}

View File

@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = SodiumWorldRenderer.class, remap = false)
public class MixinSodiumWorldRender {
@Inject(method = "drawChunkLayer", at = @At("HEAD"), cancellable = true)
@Inject(method = "drawChunkLayer", at = @At("HEAD"), cancellable = true, require = 0)
private void cancelRender(RenderLayer renderLayer, MatrixStack matrixStack, double x, double y, double z, CallbackInfo ci) {
//ci.cancel();
}

View File

@@ -112,7 +112,7 @@ void main() {
if (face == 0) {
tinting.xyz *= vec3(0.75, 0.75, 0.75);
} else if (face != 1) {
tinting.xyz *= vec3((float(face-2)/4)*0.7 + 0.3);
tinting.xyz *= vec3((float(face-2)/4)*0.3 + 0.7);
}

View File

@@ -1,5 +1,4 @@
#version 460
#extension GL_NV_compute_shader_derivatives : require
layout(local_size_x = 32, local_size_y = 32, local_size_x = 1) in;
@@ -67,23 +66,23 @@ void main() {
vec3 pos = rev3d(vec3(point, depth));
//TODO: TODO: only encode the axis, then use then it as as a mask along with pos and multiply by the -sign of everything
vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (float(int(face)&1)*2-1);//normalize(cross(dFdx(pos), dFdy(pos)));
//vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (-sign(pos));//normalize(cross(dFdx(pos), dFdy(pos)));
vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (float(int(face)&1)*2-1);
//vec3 viewNormal = vec3(uint((face>>1)==2), uint((face>>1)==0), uint((face>>1)==1)) * (-sign(pos));
float d = computeAOAngle(pos, 0.75*(1<<lod), viewNormal);//1
//if (any(lessThan(ivec3(4), abs(repro-offset)))) {// || all(lessThan(abs(repro-offset), ivec3(0.01)))
//return;
//}
if (d<0.1) {
return;
}
//vec4 ocolour = vec4(max(0, d), abs(min(0,d)), 0, 1);
//vec4 ocolour = vec4(repro-(viewNormal/2), 1);
//vec4 ocolour = vec4(viewNormal/2+0.5, 1);
vec4 ocolour = colour;
ocolour.xyz *= ((1-d)/2+0.5);
ocolour.w = 1;
imageStore(colourTex, ivec2(gl_GlobalInvocationID.xy), ocolour);
}
//vec4 ocolour = vec4(max(0, d), abs(min(0,d)), 0, 1);
//vec4 ocolour = vec4(repro-(viewNormal/2), 1);
//vec4 ocolour = vec4(viewNormal/2+0.5, 1);
//if (any(lessThan(ivec3(4), abs(repro-offset)))) {// || all(lessThan(abs(repro-offset), ivec3(0.01)))
//return;
//}