Search Unity

Rendering Multiple Copies With Lwrp

Discussion in 'General Graphics' started by joeld42, Apr 11, 2019.

  1. joeld42

    joeld42

    Joined:
    Oct 3, 2016
    Posts:
    31
    Hey, I'm new to the LWRP and was wondering if anyone had any tips on how to render an object multiple times with different transforms using it.

    I'm looking at this for an "infinite scroll" effect for a map, e.g. to render an object near the bottom of a map again off the top of it so that it wraps, but in general the problem can be boiled down to having one transform/renderer and I'd like to render it twice (or more) with a different transform (and still play nicely with shadows/culling/etc).

    I think what I want is to apply the culling step a multiple times with transformed copies of (part of) the world, then merge all the CullResults and use them as normal. Or, I could do the cull step with a few transformed copies of the camera, which is a little less elegant but would work. Any pointers on how to accomplish this?

    The scene itself (at least the parts that I am doing this for) and the culling will be fairly simple and mostly an overhead camera, so I'm not too worried about performance considerations, at least not yet, mostly trying to figure out a way to do this with the least impact on the scene and not having to customize every shader ever or something like that. This is the kind of thing that is very straightforward with a custom engine and I was hoping the LWRP would open up that sort of flexibility in Unity.

    Thanks!
    Joel
     
  2. joeld42

    joeld42

    Joined:
    Oct 3, 2016
    Posts:
    31
    Ok made some headway on this, I realized I can call DrawMesh directly on the mesh and draw offset copies of it. This will work great for me, it would still be nice to find a way to do this a little more implicitly in the render pipeline but this is a great starting point