Some (more) questions about raytracing

Hi, as title says, I have a few more questions about ray tracing;

  1. This page says that custom interpolator are not supported; so I did follow this page to “hide” the custom interpolator behind the raytracing quality shader graph node. However, the custom interpolator still works as before when I enable ray tracing. Is the list on the first list maybe not accurate anymore, or are there other drawbacks to use custom interpolator with Raytracing?

  2. Same page states spot light with box shape are not supported; does this mean I cannot use them if I use ray tracing, or does it mean these light sources are not included for raytraced GI? I guess Pyramid and Cone shapes are supposed to work correctly?

  3. I noticed that APV still affects indirect lighting if ray traced RTXGI is enabled; is it recommended to use both in parallel, does RTXGI internally benefit from APV like SSGI?

  4. it also says tessellation is not supported; again, what is the recommended setup here if tessellation is used in a project? What would be the negative side effect, would any mesh with a tessellation shader not be affected by raytraing and not included for calculation of ray traced AO / GI? Should we switch to a not tessellated shader when ray tracing is enabled?

Hey, thanks for the questions.

  1. Custom interpolator AFAIK are still not supported, they won’t create errors BUT the data shouldn’t pass as you expected between the vertex and fragment stage.

As you can see in this example. The sphere is red where raymarching can do its job, but black where information is missing and we fallback to raytracing.

  1. I believe this is supported now (since 2023.1.0a25), and we should update the documentation. I’ll take care of that.

  2. Yes, you are right, raytracing on its own isn’t a silver bullet and it needs fallbacks to give really nice
    results. The better the fallback, the better the result. Basically, after the last bounce (or when the ray got to its max length), we fallback to the next best things. You can find the indirect diffuse fallback hierarchy in the documentation.

  3. For tesselation, It’s not that meshes using tesselation won’t receive RTGI, it’s more that the raytracing effects will use the non tesselated version of the object to calculate its effects. If you are using tesselation, the raytraced effect will use the non tesselated version of this object, as if it wasn’t tesselated and its displacement is set to 0.

To go a little bit further, raytraced effects use a structure (called RayTracing Acceleration Structure, RTAS) to compute effects like reflections, shadows, RTGI.. etc. In the case of tesselation, the non tesselated object is added to the structure because the tesselated one is “deformed” directly on the GPU and there’s no simple way to access to this version to use for raytracing. It’s the same reason why vertex displacement is not supported as well.

So in this example, I tesselated and displaced the sphere from earlier. As you can see on the reflection (on the left) you can see the part that raymarched (more or less correct), the part from the raytraced reflections (It’s a sphere, not a displaced blob, and it’s still black because of the custom interpolator not being supported). Lastly, I enabled raytraced shadows so you can see that the shadow on the right is casted like it’s a sphere not a blob, but the shadow on the reflection (on the left) is looking like the blob, because shadows in ray traced reflections are not raytraced, they fallback to regular shadow maps.

Wow, thanks so much for the in depth information. Most of it should be added to the docs, I think this would help much to get a better understanding how things work!

For custom interpolator: I guess the restriction only applies to RTX effects which need the albedo information? So RTX AO would not be effected, but RTX GI and RTX SSR are?

1 Like

Here, in the example, I passed a color, but you could pass anything, it’s just that data passed through a custom interpolator from the vertex stage to the frag stage WONT be passed when this material is used in raytracing.

Yeh, I get this, but RTX AO probably doesn’t need the material at all, only geometry, or?

I can’t think of an example where this should have an impact for RTAO indeed.

1 Like