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. Dismiss Notice

Light/shadows not updating after modifying meshes

Discussion in 'HDRP Ray Tracing' started by visose, Oct 24, 2020.

  1. visose

    visose

    Joined:
    Nov 2, 2014
    Posts:
    28
    When modifying meshes at runtime, some shadowing artifacts appear.
    We have marked the meshes as dynamic, but we think there might be some raytracing related acceleration structure or similar that is not being updated after modifying the mesh.

    See below for a before and after, the darker rectangle in the front face of the second image looks like a remnant of the original shape of the geometry (it shouldn't be there).

    Edit: The problem is not observed if a new mesh instance is created after every change of geometry, rather than reusing the same one.
    Also, calling mesh.MarkModified() doesn't seem to have any effect.

    upload_2020-10-24_11-43-11.png

    upload_2020-10-24_11-41-54.png
     
    Last edited: Oct 24, 2020
  2. INedelcu

    INedelcu

    Unity Technologies

    Joined:
    Jul 14, 2015
    Posts:
    158
    Hi!

    Are you using Dynamic Geometry for Ray Tracing Mode in that Mesh Renderer?
     

    Attached Files:

  3. visose

    visose

    Joined:
    Nov 2, 2014
    Posts:
    28
    We had the default 'dynamic transform', I will change and test.
     
  4. visose

    visose

    Joined:
    Nov 2, 2014
    Posts:
    28
    That was it, great, thank you!
     
    INedelcu likes this.