adopt AO calculation tweak from Indigo
This commit is contained in:
@@ -4,7 +4,7 @@ org.gradle.daemon=false
|
||||
group = com.github.octarine-noise
|
||||
jarName = BetterFoliage-Forge
|
||||
|
||||
version = 2.6.1
|
||||
version = 2.6.3
|
||||
|
||||
mcVersion = 1.15.2
|
||||
forgeVersion = 31.2.44
|
||||
|
||||
@@ -23,6 +23,10 @@ data class LightingData(
|
||||
}
|
||||
}
|
||||
|
||||
// Vanilla has a very suspicious-looking offset here, which Indigo gets rid of and calls it a fix
|
||||
// Naturally, we're going to believe Indigo, it's a hardcoded option for now
|
||||
const val OCCLUSION_OFFSET_FIX = true
|
||||
|
||||
/**
|
||||
* Replacement for [BlockModelRenderer.AmbientOcclusionFace]
|
||||
* This gets called on a LOT, so object instantiation is avoided.
|
||||
@@ -87,9 +91,9 @@ class VanillaAoCalculator {
|
||||
sideHelper.sides.forEachIndexed { sideIdx, sideDir ->
|
||||
// record light data in the block 1 step to the side
|
||||
probe.position { setPos(lightOrigin).move(sideDir) }.writeTo(sideAo[sideIdx])
|
||||
// side is considered occluded if the block 1 step to that side and
|
||||
// 1 step forward (in the lightface direction) is not fully transparent
|
||||
isOccluded[sideIdx] = probe.position { move(lightFace) }.isNonTransparent
|
||||
// side is considered occluded if the block 1 step to that side is not fully transparent
|
||||
if (!OCCLUSION_OFFSET_FIX) probe.position { move(lightFace) }
|
||||
isOccluded[sideIdx] = probe.isNonTransparent
|
||||
}
|
||||
|
||||
// AO Calculation for the 4 corners
|
||||
|
||||
Reference in New Issue
Block a user