Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

No Vegetation Assets on Asset Store work with Raytracing

Discussion in 'HDRP Ray Tracing' started by newguy123, Sep 20, 2021.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi Guys

    This is becoming a major problem. Since most of the major Asset Store devs use Amplify Shaders to build their Shaders on their plants (for example Nature Manufacture, DE Environment, The Vegetation Engine, etc), and Amplify Shaders does not support raytracing, that means no vegetation on the asset store support raytracing! Well, I have not found a single vegetation asset that supports raytracing. Shadows and alpha cutout seems to be the major issue. I'm not sure about wind animation, but just the fact that you cant get proper shadows.......

    This is preventing us from doing various projects with Unity and we have to stick to traditional offline rendering which takes forever.

    Does anybody know of any high quality assets that work with raytracing in HDRP 11.x or HDRP 12.x?
     
    Last edited: Sep 20, 2021
    Lex4art likes this.
  2. INedelcu

    INedelcu

    Unity Technologies

    Joined:
    Jul 14, 2015
    Posts:
    173
    Hi!

    Assets from Asset Store cannot magically support ray tracing. Shaders that support ray tracing effects (e.g. Lit.shader) have dedicated ray tracing shader passes with HLSL code that matches each ray tracing effect supported by HDRP. Currently only MeshRenderers and SkinnedMeshRenderers are supported by acceleration structures. Each tool that generates shaders will have to generate ray tracing shader passes to be supported by HDRP ray tracing effects.
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yes I realise its not magic nor automatic. The point I was making is that nobody seems to have assets that support it, therefore my question if anybody knows of any assets that I may have overlooked in my extensive search.
     
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    The only way I can see to work around the current limitation is to import FBX models and apply regular HDRP Lit shaders to them. That of course in itself will kill performance and likley will limit the ability to scatter thousands of objects as we currently do with traditional offline rendering.
     
  5. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Even if ASE supported raytracing passes that wouldn't make any difference, you can't have vertex offset in current raytracing acceleration structure - meaning your wind effects wouldn't show up properly in RT reflections and other effects would look incorrect as well.

    For the foliage with wind, I'd suggest using new enough Unity version that has "mixed" mode for raytracing, that way you can use screenspace data with raymarched reflections etc for items that can't work with current raytracing implementation and mix those with real raytracing for the objects that are supported by raytracing.
     
    Last edited: Sep 24, 2021
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    @rz_0lento that sounds like something I would be VERY interested in. Could you give me some more details please?

    How do I get this mixed mode going? Could I do it with 2021.2? DLSS is also the only solution I found that is perfect for the AA issues we've been having with TAA or any other method.

    A mixed mode like you describe would be perfect. In fact, if we could get our buildings fully raytraced, and then foilage some kind of fake "good enough" that would be good until a better solution comes down the line...
     
  7. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    It's been in 2021.2 for a good while now: https://github.com/Unity-Technologies/Graphics/pull/3747
    They've renamed the options from Hybrid to Mixed since that PR got merged but idea is the same.

    Basically you can opt RT volume components to use "Mixed" Tracing mode (it's first option listed after enable there) and then objects whose MeshRenderer's "Ray Tracing Mode" is set to "Off" will use the screenspace raymarching for that specific effect. In your case you'd disable the ray tracing from your foliage objects mesh renderers.
     
  8. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    As example, here the capsule on the left has Mesh Renderer set for Ray Tracing by default and the capsule on the right has override for no RT (note the reflection missing the data that's not present in the screen buffer, this way you can tell it's not raytraced)
     
    m0nsky likes this.
  9. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hmmm @rz_0lento this technique is interesting, but only works sort of to an extent. Now the next problem is, if you set the meshrender raytracing mode to none, then the object does not cast any shadows!?! (direct light is set to cast raytraced shadows, which I need for my other objects)

    upload_2021-9-27_21-33-20.png

    vs

    upload_2021-9-27_21-34-29.png

    In this example, the tree has regular HDRP Lit shaders applied:
    upload_2021-9-27_21-35-21.png

    Would be nice if they could make a similar "mixed" mode for raytraced shadows
     
    Last edited: Sep 27, 2021