diff --git a/gradle.properties b/gradle.properties index fb5909596..10068585a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,11 +5,11 @@ group=grondag mod_name=canvas canvas_version=1.0 -fermion_version=2.0 +fermion_version=2.1 special_circumstances_version=1.6 -fermion_varia_version=2.0 +fermion_varia_version=2.1 fermion_orientation_version=1.0 -frex_version=2.2 +frex_version=2.3 jankson_version=3.0.0+j1.2.0 clothconfig_version=4.5.3 diff --git a/src/main/java/grondag/canvas/light/LightmapHdCalc.java b/src/main/java/grondag/canvas/light/LightmapHdCalc.java index b90db54f4..f21554609 100644 --- a/src/main/java/grondag/canvas/light/LightmapHdCalc.java +++ b/src/main/java/grondag/canvas/light/LightmapHdCalc.java @@ -254,39 +254,39 @@ static void computeAo(int[] light, AoFaceData faceData) { // } } - private static void computeQuadrantAo(float center, float uSide, float vSide, float corner, int light[], Int2IntFunction uFunc, Int2IntFunction vFunc) { - //FIX: handle error case when center is missing - if(uSide == AoFaceData.OPAQUE) { - if(vSide == AoFaceData.OPAQUE) { - // fully enclosed - computeOpen(center, center - 0.5f, center - 0.5f, center - 0.5f, light, uFunc, vFunc); - } else if (corner == AoFaceData.OPAQUE) { - // U + corner enclosing - uSide = center - 0.25f; - computeClamped(center, uSide, (vSide + center) * 0.5f, (uSide + vSide - 0.25f) * 0.5f, light, uFunc, vFunc); - } else { - // U side enclosing - final float join = (center + vSide + corner) / 3f; - computeClamped(center, center - 0.25f, (vSide + center) * 0.5f, join, light, uFunc, vFunc); - } - } else if(vSide == AoFaceData.OPAQUE) { - if(corner == AoFaceData.OPAQUE) { - // V + corner enclosing - vSide = center - 0.25f; - computeClamped(center, (uSide + center) * 0.5f, vSide, (uSide + vSide - 0.25f) * 0.5f, light, uFunc, vFunc); - } else { - // V side enclosing - final float join = (center + uSide + corner) / 3f; - computeClamped(center, (uSide + center) * 0.5f, center - 0.25f, join, light, uFunc, vFunc); - } - - } else if(corner == AoFaceData.OPAQUE) { - // opaque corner - final float join = (center + uSide + vSide) / 3f; - computeClamped(center, (uSide + center) * 0.5f, (vSide + center) * 0.5f, join, light, uFunc, vFunc); - } else { - // all open - computeOpen(center, uSide, vSide, corner, light, uFunc, vFunc); - } - } + // private static void computeQuadrantAo(float center, float uSide, float vSide, float corner, int light[], Int2IntFunction uFunc, Int2IntFunction vFunc) { + // //FIX: handle error case when center is missing + // if(uSide == AoFaceData.OPAQUE) { + // if(vSide == AoFaceData.OPAQUE) { + // // fully enclosed + // computeOpen(center, center - 0.5f, center - 0.5f, center - 0.5f, light, uFunc, vFunc); + // } else if (corner == AoFaceData.OPAQUE) { + // // U + corner enclosing + // uSide = center - 0.25f; + // computeClamped(center, uSide, (vSide + center) * 0.5f, (uSide + vSide - 0.25f) * 0.5f, light, uFunc, vFunc); + // } else { + // // U side enclosing + // final float join = (center + vSide + corner) / 3f; + // computeClamped(center, center - 0.25f, (vSide + center) * 0.5f, join, light, uFunc, vFunc); + // } + // } else if(vSide == AoFaceData.OPAQUE) { + // if(corner == AoFaceData.OPAQUE) { + // // V + corner enclosing + // vSide = center - 0.25f; + // computeClamped(center, (uSide + center) * 0.5f, vSide, (uSide + vSide - 0.25f) * 0.5f, light, uFunc, vFunc); + // } else { + // // V side enclosing + // final float join = (center + uSide + corner) / 3f; + // computeClamped(center, (uSide + center) * 0.5f, center - 0.25f, join, light, uFunc, vFunc); + // } + // + // } else if(corner == AoFaceData.OPAQUE) { + // // opaque corner + // final float join = (center + uSide + vSide) / 3f; + // computeClamped(center, (uSide + center) * 0.5f, (vSide + center) * 0.5f, join, light, uFunc, vFunc); + // } else { + // // all open + // computeOpen(center, uSide, vSide, corner, light, uFunc, vFunc); + // } + // } } diff --git a/src/main/java/grondag/canvas/shader/GlShader.java b/src/main/java/grondag/canvas/shader/GlShader.java index e01ada247..528af947e 100644 --- a/src/main/java/grondag/canvas/shader/GlShader.java +++ b/src/main/java/grondag/canvas/shader/GlShader.java @@ -166,6 +166,8 @@ private static void clearDebugSource() { } } + private static boolean needsDebugOutputWarning = true; + private void outputDebugSource(String source, String error) { final String key = shaderSource.toString().replace("/", "-") + "." + context.name; final File gameDir = FabricLoader.getInstance().getGameDirectory(); @@ -190,7 +192,10 @@ private void outputDebugSource(String source, String error) { writer.write(source); writer.close(); } catch (final IOException e) { - // TODO: log failure to output source + if (needsDebugOutputWarning) { + CanvasMod.LOG.error(I18n.translate("error.canvas.fail_create_shader_output", shaderDir), e); + needsDebugOutputWarning = false; + } } } } diff --git a/src/main/resources/assets/canvas/lang/en_us.json b/src/main/resources/assets/canvas/lang/en_us.json index 95acdd66d..ad0bdbf1b 100644 --- a/src/main/resources/assets/canvas/lang/en_us.json +++ b/src/main/resources/assets/canvas/lang/en_us.json @@ -2,6 +2,7 @@ "debug.canvas.missing_uniform" : "Canvas unable to find uniform %s in shaders %s, %s. This is normal if the uniform isn't used in the shader.", "info.canvas.reloading" : "Canvas Renderer is initializing.", "error.canvas.fail_create_shader" : "Canvas unable to create shader %s with property index %d due to unexpected error: %s.", + "error.canvas.fail_create_shader_output" : "Canvas unable to create shader output folder %s due to unexpected error.", "error.canvas.fail_create_any_shader" : "Canvas unable to create one or more shaders due to compilation errors. See canvas_shader_debug folder for details.", "error.canvas.program_link_failure" : "Canvas unable to create linked shader due to unexpected error.", "error.canvas.fail_create_lightmap" : "Canvas unable to create HD lightmap(s) - out of space. \nSome blocks will not render with proper lighting. \nReduce view distance or disable HD lightmaps. F3+A will temporarily clear this problem.",