debug pain
This commit is contained in:
@@ -5,5 +5,6 @@ layout(location = 0) in vec2 uv;
|
||||
layout(binding = 0) uniform sampler2D depthTex;
|
||||
void main() {
|
||||
vec4 depths = textureGather(depthTex, uv, 0); // Get depth values from all surrounding texels.
|
||||
//depths = mix(vec4(0), depths, lessThanEqual(vec4(0.99999999), depths));
|
||||
gl_FragDepth = max(max(depths.x, depths.y), max(depths.z, depths.w)); // Write conservative depth.
|
||||
}
|
||||
@@ -69,7 +69,7 @@ void setupScreenspace(in UnpackedNode node) {
|
||||
maxBB = maxBB*0.5f+0.5f;
|
||||
minBB = minBB*0.5f+0.5f;
|
||||
|
||||
size = (maxBB.xy - minBB.xy);//We half it for implicit conversion to screenspace
|
||||
size = clamp(maxBB.xy - minBB.xy, vec2(0), vec2(1));//We half it for implicit conversion to screenspace
|
||||
|
||||
}
|
||||
|
||||
@@ -85,8 +85,12 @@ bool isCulledByHiz() {
|
||||
vec2 ssize = size.xy * vec2(screenW, screenH);
|
||||
float miplevel = ceil(log2(max(max(ssize.x, ssize.y),1)));
|
||||
vec2 midpoint = (maxBB.xy + minBB.xy)*0.5f;
|
||||
// printf("HiZ sample point culled: (%f,%f)@%f against %f", midpoint.x, midpoint.y, miplevel, minBB.z);
|
||||
return textureLod(hizDepthSampler, vec3(midpoint, minBB.z), miplevel) < 0.0001f;
|
||||
bool culled = textureLod(hizDepthSampler, vec3(midpoint, minBB.z), miplevel) < 0.0001f;
|
||||
/*
|
||||
if (culled) {
|
||||
printf("HiZ sample point not culled: (%f,%f)@%f against %f, level %d", midpoint.x, midpoint.y, miplevel, minBB.z, lod);
|
||||
}*/
|
||||
return culled;
|
||||
}
|
||||
|
||||
//Returns if we should decend into its children or not
|
||||
|
||||
@@ -72,7 +72,7 @@ void traverse(in UnpackedNode node) {
|
||||
//printf("A");
|
||||
enqueueChildren(node);
|
||||
} else {
|
||||
printf("B");
|
||||
//printf("B");
|
||||
addRequest(node);
|
||||
//TODO: use self mesh (is error state if it doesnt have one since all leaf nodes should have a mesh)
|
||||
// Basicly guarenteed to have a mesh, if it doesnt it is very very bad and incorect since its a violation of the graph properties
|
||||
@@ -81,10 +81,10 @@ void traverse(in UnpackedNode node) {
|
||||
}
|
||||
} else {
|
||||
if (hasMesh(node)) {
|
||||
printf("C");
|
||||
//printf("C");
|
||||
enqueueSelfForRender(node);
|
||||
} else {
|
||||
printf("D");
|
||||
//printf("D");
|
||||
//!! not ideal, we want to render this mesh but dont have it. If we havent sent a request
|
||||
// then send a request for a mesh for this node.
|
||||
addRequest(node);
|
||||
|
||||
Reference in New Issue
Block a user