Tinkering
This commit is contained in:
@@ -7,7 +7,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
|
|
||||||
@Mixin(value = OcclusionCuller.class, remap = false)
|
@Mixin(value = OcclusionCuller.class, remap = false)
|
||||||
public class MixinOcclusionCuller {
|
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) {
|
private static float redirectAbs(float a) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
|
|
||||||
@Mixin(value = SodiumWorldRenderer.class, remap = false)
|
@Mixin(value = SodiumWorldRenderer.class, remap = false)
|
||||||
public class MixinSodiumWorldRender {
|
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) {
|
private void cancelRender(RenderLayer renderLayer, MatrixStack matrixStack, double x, double y, double z, CallbackInfo ci) {
|
||||||
//ci.cancel();
|
//ci.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ void main() {
|
|||||||
if (face == 0) {
|
if (face == 0) {
|
||||||
tinting.xyz *= vec3(0.75, 0.75, 0.75);
|
tinting.xyz *= vec3(0.75, 0.75, 0.75);
|
||||||
} else if (face != 1) {
|
} 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#version 460
|
#version 460
|
||||||
#extension GL_NV_compute_shader_derivatives : require
|
|
||||||
layout(local_size_x = 32, local_size_y = 32, local_size_x = 1) in;
|
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));
|
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
|
//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)) * (float(int(face)&1)*2-1);
|
||||||
//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)) * (-sign(pos));
|
||||||
|
|
||||||
|
|
||||||
float d = computeAOAngle(pos, 0.75*(1<<lod), viewNormal);//1
|
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) {
|
if (d<0.1) {
|
||||||
return;
|
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;
|
vec4 ocolour = colour;
|
||||||
ocolour.xyz *= ((1-d)/2+0.5);
|
ocolour.xyz *= ((1-d)/2+0.5);
|
||||||
ocolour.w = 1;
|
ocolour.w = 1;
|
||||||
imageStore(colourTex, ivec2(gl_GlobalInvocationID.xy), ocolour);
|
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;
|
||||||
|
//}
|
||||||
Reference in New Issue
Block a user