• Advertisement
Sign in to follow this  

Help with GPU Pro 5 Hi-Z Screen Space Reflections

This topic is 1084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, the red rectangle on the left marks indeed rays moving towards the camera.

I do this with a linear ray march. But the rectangle on the right shows the rays, computed with Hi-Z ray tracing.

 

Yasin Uludag talks about a way to travel rays behind geometry, but he does not explain it in detail.

Only that a min- and max Hi-Z buffer is required, and that it's quite complicated.

 

Anyway I won't spent much more time on this problem before I complete my Bachelor thesis.

 

Greetings,

Lukas

Share this post


Link to post
Share on other sites
Advertisement
Hi Lukas,
I don't have my code in front of me at the moment, but a few things I can think of.

What format is your HiZ buffer? I'm storing scene depth in a DXGI_D32_FLOAT format, so use DXGI_FORMAT_R32G32 for my min/max HiZ buffer to make sure I can get the depth as accurate as possible.

Also, what MIP level (HiZ start) are you starting at and what is the highest level you let the effect run to (HiZ stop)?

Tracing behind objects should work in a lot of cases if you have the buffer constructed properly and have followed the code in this thread. There are still cases where it will fail, but that's always going to be the case for screen space effects where you're trying to reconstruct data that isn't available.

-WFP

Share this post


Link to post
Share on other sites

I'm using R32G32 Float as well, and the min and max Z values are available to me in the final shader stage.

I start with the MIP level 2 and I stop when the MIP level reached 0.

Share this post


Link to post
Share on other sites

Hi Lukas,

The best I can tell you right now are the values I'm using for my setup:

static const float HIZ_START_LEVEL = 0.0f; // always start <= HIZ_STOP_LEVEL
static const float HIZ_STOP_LEVEL = 0.0f; // set higher to use less iterations - quality vs performance tradeoff
static const float HIZ_MAX_LEVEL = float(cb_mipCount);
static const float2 HIZ_CROSS_EPSILON = float2(texelWidth, texelHeight) * 0.5f; // just needs to make sure in the next pixel, not skipping them entirely
static const uint MAX_ITERATIONS = 128u; // a good balance of quality vs performance - most common cases will not use anywhere near this full value
static const float2 hiZSize = cb_screenSize / exp2(HIZ_START_LEVEL);

I know you've said you can't share your code until your thesis is complete, but unfortunately I can't help much more without being able to see what you've got so far.  If something changes, definitely post your code here and I'd be happy to review it.

 

Thanks,

WFP

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement