Search Unity

Feedback RenderParams class is inconvenient for my use case.

Discussion in 'General Graphics' started by quinng, May 26, 2023.

  1. quinng

    quinng

    Joined:
    Jul 2, 2015
    Posts:
    22
    I recently replaced all uses of Graphics.DrawMesh (marked as obsolete) with Graphics.RenderMesh in my project.

    My system involves rendering multiple collections ('rooms') of meshes in different locations. Each room needs to be rendered at a different place in the rendering order, so I generate a common material instance configured for each room. The different meshes in each room get their specific textures from their Material Property Block.
    My feedback is that bundling Material and Material Property Block in with the is a potential memory cost for my use-case. Previously all meshes in a room instance could share a material, and all instances of each mesh could share a Material Property Block. No I need to construct and store a Render Params for each combination of these two data sources.

    Is there any plan for overloads of Graphics.RenderMesh that could receive this information, particularly the Material Property Block, as separate parameters?