This commit is contained in:
@@ -44,7 +44,7 @@ public class HiZBuffer {
|
||||
private void alloc(int width, int height) {
|
||||
this.levels = (int)Math.ceil(Math.log(Math.max(width, height))/Math.log(2));
|
||||
//We dont care about e.g. 1x1 size texture since you dont get meshlets that big to cover such a large area
|
||||
this.levels -= 1;//Arbitrary size, shinks the max level by alot and saves a significant amount of processing time
|
||||
//this.levels -= 1;//Arbitrary size, shinks the max level by alot and saves a significant amount of processing time
|
||||
// (could probably increase it to be defined by a max meshlet coverage computation thing)
|
||||
|
||||
//GL_DEPTH_COMPONENT32F //Cant use this as it does not match the depth format of the provided depth buffer
|
||||
|
||||
@@ -11,8 +11,8 @@ void main() {
|
||||
//TODO, do it so that for the first 2,3 levels if 1 (or maybe even 2 (on the first layer)) pixels are air, just ignore that
|
||||
// this is to stop issues with 1 pixel gaps
|
||||
bvec4 cv = lessThanEqual(vec4(0.99999999), depths);
|
||||
if (any(cv) && !all(cv)) {
|
||||
depths = mix(vec4(1.0f), depths, cv);
|
||||
}
|
||||
//if (any(cv) && !all(cv)) {
|
||||
// depths = mix(vec4(1.0f), depths, cv);
|
||||
//}
|
||||
gl_FragDepth = max(max(depths.x, depths.y), max(depths.z, depths.w)); // Write conservative depth.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user