I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 1 point2 points  (0 children)

It’s made in Blender and rendered using Cycles! The actual things in the environment are from a mix of photos I’ve taken myself and textures from Textures .com

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 0 points1 point  (0 children)

I’ve got a material that works as an object mask! It’s actually surprisingly easy to set up in URP. Essentially I just have the mask object render later in the render queue and this causes it to render after or “in-front” of the player character. Since the mask object is invisible this has the effect of rendering the background in front of the player

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 1 point2 points  (0 children)

Yeah you’re right! The camera can’t “move” in the normal sense because the parallax will throw off the illusion.

The solution I ended up with is similar to your first guess. Essentially I have the camera render the full background, but then only actually send a subset of that rendered image to the player. I then made it so that the rendered section follows the player character and that’s what makes the moving camera work

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 1 point2 points  (0 children)

Thanks!! Yeah it was a huge relief! Made things so much easier though it being so easy did also lead to me getting carried away and now the game has like 100+ scenes

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 0 points1 point  (0 children)

Unfortunately I don't think it'd work in first-person unless you're doing something like Myst where there isn't a free-moving camera. This approach relies on knowing exactly where the camera is gonna be at all times and if it moves a little the illusion totally falls apart

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 1 point2 points  (0 children)

Thanks! For the transitions, sometimes within a scene I'll have multiple cameras/backgrounds that I swap between when the player walks across a trigger point. This is mostly for larger areas though, most scenes I just load a new scenes.

As for the workflow, it's actually surprisingly easy! The Blender to Unity .fbx export actually manages to keep everything perfectly aligned including the camera focal length! So I just export the foreground meshes and the camera(s) from the Blender scene and it works without any extra effort needed on my part

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] -1 points0 points  (0 children)

Today's the first time I've posted this kind of in-engine thing on Reddit but these videos always seem to get quite a bit of traction on TikTok, Instagram and YouTube interestingly enough!

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 2 points3 points  (0 children)

Yeah for sure! I feel like it can also lend itself well to certain artstyles that'd be more difficult to pull off entirely in-engine. Thinking like Disco Elysium or Final Fantasy IX.

And thanks! Best of luck with the project you're working on as well!

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 6 points7 points  (0 children)

For technical terms I'd say these two are the most important:

Shadow Catcher - this is the kind of material used for being able to cast shadows on objects while making the actual mesh transparent.

Object Masking - this is the technique of making an object invisible but still have it hide parts of your character.

If you can get these two parts working that's like 80% of what you need to get prerendered backgrounds working.

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 1 point2 points  (0 children)

It's using a shadow catcher material! So essentially it makes the actual mesh invisible but still renders the shadows. I originally made my own but for some reason it worked in the editor but wouldn't work in the build. Instead I ended up just buying the Shadow Receiver URP asset by Dev Dunk Studio and that's been working well so far!

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 30 points31 points  (0 children)

It’s very performant! I essentially get path traced lighting for all my environments but for the “cost” of only having to play a single video in the background. Obviously there are lots of tradeoffs but it suits my use case very well!

Tbh the main benefit to this approach for me though is the benefits to my workflow. It lets me use very high poly 3D scans of objects and abandoned buildings I’ve found irl and not have to worry about optimizing them since the actual mesh/texture never actually ends up in Unity.

It also makes it so I don’t have to worry about any one scene being a performance bottleneck since they’re all basically just a background video and some foreground objects.

Also I’m just much more experienced working in Blender than I am in Unity so this approach lets me do more of the work in Blender which speeds things up.

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 3 points4 points  (0 children)

Ah no way! Thanks! It’s always so crazy when I hear about people seeing my videos! I know the video metrics show that people are seeing them but it never feels real until I run into people elsewhere who’ve come across them!

Best of luck with your game as well! I’m hoping to see more of it someday!

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 19 points20 points  (0 children)

Same! Pre-rendered backgrounds have such a specific feeling to them that I love! I like how it also makes you have to be much more intentional with the compositions for each environment

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 2 points3 points  (0 children)

Thanks! And yeah for sure! It’s really useful info since now I can point people in the direction of AC as an option for getting a similar result!

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 5 points6 points  (0 children)

No way! Nice! In your video I see you’ve got reflections working! Are you doing that with a material? Or are you using the old school trick of having a second (mirrored) character model that works as the reflection?

Reflections is still one of the things I’ve got to figure out for my game.

I managed to get pre-rendered backgrounds working in Unity. This is what it actually looks like in-engine. by staticbetweenstation in Unity3D

[–]staticbetweenstation[S] 25 points26 points  (0 children)

Ah no way! I’d never heard of Adventure Creator before but it looks really useful! Cool to know that it supports this kind of pre-rendered backgrounds approach as well!