Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug DXR Bugs -- Generally and for manual RTAS code

Discussion in '2023.1 Beta' started by Klani, Apr 30, 2023.

  1. Klani


    Nov 4, 2017
    Currently for: 2023.1.0b14 but these things were seen with at least b13/12/11 as well

    This is my first forum post
    ..not sure whether I should create a bug report for each of those but I'll just summarize them all here

    All materials used in testing are using the "HDRP/Lit" shader

    For the "Ray Tracing Settings" override whether I am using "CullInstances()" with "Manual" or instead directly use "Automatic" I am not seeing shadows for the existing gameObjects of the scene

    There seems to be an unintentional fallback mode for at least SSAO when having the "Ray Tracing" checkbox disabled and then further disabling the volume override
    ..or it's the other way around and fallbacks instead are missing for other things like SSGI, SSR and especially SSS
    => Right now objects not within the RTAS don't cast shadows at all and a fallback for that would be nice for mixed use cases which I do have

    Which leads to the next point
    => Objects not within the RTAS (rendered with "RenderMeshXXX" functions, which thus don't have any (fallback) shadows) are still affected by (fallback?) SSAO and SSGI

    Having the "Ray Tracing Settings" override enabled and then toggling the "Path Tracing" override can cause a massive constant FPS drop while it's disabled
    ..entering/leaving play mode fixes/resets this behavior respectively
    This is easily reproducable but doesn't always happen
    ..this could further be amplified by having underlying manual RTAS camera assigments that run for both the edit and play mode but I have no accurate data on that as it happens for both cases(not running the assignments at all) either way

    Next up some points about using "manual" RTAS, also together with "AddInstances()"

    Objects added through "AddInstances" only work with the "Path Tracing" override enabled
    => else they only exclusively show up in either pure reflections or via indirect shadowy artifacts
    Further issues could exist but aren't testable as the objects don't directly show up afterall anyway
    .."Path Tracing" itself seems to work fine generally
    RayTracing -- Exclusive reflections and indirect imprints.png

    The "RayTracingMeshInstanceConfig" has a broken or undefined default constructor
    This here works
    rtInstanceConfig = new(null, 0, null);
    rtInstanceConfig.mesh = mesh;

    This here does not work
    rtInstanceConfig = new();
    rtInstanceConfig.mesh = mesh;

    I want to use a single global variable and not need to re-create the struct per frame => for loop rotation which is the current workaround with the null passes

    For both "RayTracingInstanceCullingConfig" and "RayTracingMeshInstanceConfig" the "subMeshFlagsConfig" and "subMeshFlags" respectively have a potential issue with "RayTracingSubMeshFlags.ClosestHitOnly"
    => Using this flag with ex: "tree leaves" that use alpha clipping it does work like expected, however the shader still gets correctly applied in reflections of the tree thus alpha clipping is being applied in reflections which it shouldn't I'd expect since the direct representation of course doesn't apply alpha clipping if that is unintentional the flag should probably be checked on not only for reflections but where ever else it is(should be) used in
    PathTracing -- Original vs Reflection -- RayTracingSubMeshFlags.ClosestHitOnly.png
    Last edited: Apr 30, 2023
    newguy123 likes this.
  2. TomTheMan59


    Mar 8, 2021
    Please create a bug report! If you look throughout the forums the devs always say to do it. You can always post the IN number once you get it.
    newguy123 likes this.
  3. newguy123


    Aug 22, 2018
    Could you perhaps comment on any of the OP fascinating findings/questions please @INedelcu ?
  4. INedelcu


    Unity Technologies

    Jul 14, 2015
    TomTheMan59 likes this.