mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Add dithering when transitioning to raymarching lod.
This commit is contained in:
parent
f0b5ba3249
commit
3d19feae42
@ -227,7 +227,10 @@ bool passDitherTest(float alpha) {
|
||||
void main() {
|
||||
RayMarchResult result;
|
||||
float variance = perpendicularFwidth(direction);
|
||||
if(variance <= 4.0) {
|
||||
const float threshold = 1;
|
||||
const float interpolationRegion = 1.25;
|
||||
float interp = (variance - threshold)/threshold/(interpolationRegion - 1);
|
||||
if(!passDitherTest(interp)) {
|
||||
result = rayMarching(startPosition, direction);
|
||||
} else {
|
||||
result = RayMarchResult(true, faceNormal, faceNormal, ivec3(startPosition)); // At some point it doesn't make sense to even draw the model.
|
||||
|
Loading…
x
Reference in New Issue
Block a user