I’m not sure what this is called, but i’ve seen it in a number of places.
Essentially what i’m wondering is how to pick a place in the world, give it a radius, and then let it take all the geometry within that radius and render it somewhere else at whatever scale and rotation i want.
How should i go about creating this shader, or if it’s already available somewhere, i’m totally fine with purchasing (though i’d rather code it myself)
The Chessboard in this Unity VR editor video is essentially doing what i’m talking about.
Anyone have any ideas on how they accomplished this?
I’m thinking the closest thing i can do is to create a way to look at the world from a point in space, and then fill a bunch of dummy gameobjects with mesh renderer and mesh filters to re-render the world from another perspective with alternate scale.
However, then that problem of clipping comes in, how would they have clipped the objects within that box?
It’s somewhat trivial to do that clipping in a shader. You can use a matrix to define the position, orientation, and size of a box, and clip against that with a mul(), an abs(), two max(), a clip(), and one subtract.
To calculate that matrix you could just put a game object in the scene and pass its transform.worldToLocalMatrix to the shader.
The harder part is only rendering the meshes you need. I don’t know the best way to do that, though I know stuff like Sunshine does this. You would want a list of every renderer in your area, and re-render it with the custom box clip shader and a manual transform (to scale and place it in the “mini map” area). There’s a lot of heavy lifting there that something like a replacement shader camera render would better handle, but I can’t think of a way to use that here.