mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-09 12:16:24 -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() {
|
void main() {
|
||||||
RayMarchResult result;
|
RayMarchResult result;
|
||||||
float variance = perpendicularFwidth(direction);
|
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);
|
result = rayMarching(startPosition, direction);
|
||||||
} else {
|
} else {
|
||||||
result = RayMarchResult(true, faceNormal, faceNormal, ivec3(startPosition)); // At some point it doesn't make sense to even draw the model.
|
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