I am currently looking into ways to create a “pre-rendered’ or hand-drawn background environment for my isometric perspective game and got the idea to take a full-size, to-scale screenshot (relative to the player character) of the entire game level beyond what can normally be seen by the camera at any given time. I have read about potentially just zooming a second camera out and taking a screenshot that way, but the goal was to have a screenshot that an artist could draw over and import into Unity so that the player character and in-game camera perspective perfectly scales with the imported background and I’m not sure a zoomed out screenshot would do this well.
Is there an existing asset/tool or example of how to do this? I’m basically trying to do a large, isometric, scrollable version of the pre-rendered backgrounds from the old resident-evil or final fantasy games by drawing over a screenshot of a white boxed level from a Unity project.
This is an interesting problem. I’ve had doing this exactly on my backlog.
Here was my plan:
- Have Snapshot camera.
- Render specific layers (background layers) on this camera.
- Output Snapshot camera to Render Texture. It will probably help later if it’s 1:1 aspect and the RT is 1:1 dimensions.
- Manually .Render() the camera.
- Save Render Texture to PNG: you can use rt.ReadPixels to read the RenderTexture into a normal Texture2D, then you can save that using tex.EncodeToPNG.
- Reposition the camera so that it slightly overlaps its last snapshot. This is to prevent seams. But maybe it is possible for your case to do this pixel-perfectly so you don’t need any overlap.
- Repeat until you have a full snapshot of the scene, or a big chunk of it.
- Combine the pngs together. I suppose you could save the Texture2Ds until this step, then read make a huge one and dump their data into this big texture then finally output as PNG.
Patching together the PNGs might be more trouble than it’s worth so once you have a PNG it could be worth using that directly in your scene. For you I think the workflow of the artist matters too.
Ok you have my plan. If it works out please let me know!
1 Like
Will do! I’ll let you know what I figure out. Thanks
@bbaugh007 Did you get it to work?
I ended up doing something similar, but it just takes a extremely huge screenshot of everything at once at a certain angle. Hopefully, once I start working with artists, it will be enough for them to work with. Thanks for your help.
I also have an idea for grid-based collision object placement to match up with what the artist draws.
1 Like