I’ve been working on a classic survival horror game and have decided to go with pre-rendered backgrounds. I was wondering if anyone with more experience has done it before and can help streamline the process. I have a feeling I’m over complicating an extremely easy solution. My process right now is:
Build the full scene in blender.
Set up the cameras in blender (taking time to change the MM to FOV, and jotting down the rotation degrees of the camera angle in Blender).
3)Set the render resolution to a scale of 4:3 and pray it’s the right size and scale for the player model.
Upload the images into Godot
Try and approximate the correct angle and distance since Godot and Blender aren’t lining up with camera angles. Maybe I’m missing something?
Trial and error the collision detection objects.
Set up cameras and Trigger areas for swapping over cameras. (Shudder at the thought of using a single camera and Node positions)
Repeat for every camera angle in the room.
Plus I would need to keep in mind that it will need to support split-screen.
Any advice or tricks I can use would be fantastic!
I’m pretty sure you could also export the scene as a gtf2 or something and have placements of meshes and you could add an Empty to the blender scene with the camera as child and at origin. Modify the blender Empty to get your shot and when it’s exported, Godot will parse that Empty into a node3d. Then you just add a camera to it and done.
Hi there! I just got done giving it and go! and it 100% works! The problem is I’m trying to work with the PNGs and not the 3D model itself in Godot. (granted given how easy it is to just plug and play with this method, I’m tempted to just to real-time 3D) lol. Thank you again!
I didn’t even know I could use a UV Projection. So I’ll have to do some research on that!
I can get the 3D model into Godot, and I can now get the cameras to line up 100% more easily. The problem I’m encountering is that I’m using PNGs sort of like a stage show, and in doing so, the camera and models are wonky. From what I’m gathering from your post though, it seems like it possible to project the image from the camera itself? I’m assuming it would be through Godot’s Camera, or through Blender? Or are you saying that I can take the 3D model and then re-texture it with the PNG, and use the collisions set up in blender?
Again, I’m in the process of testing out this as well and will update! I will also try and upload some sort of video or image of what I have now.
I was thinking you wouldnt need to use the actual 3d models but it could be helpful for setting up the collision placement and where the floor is for the player, if there is one. I like your idea.
So you were using the shader on a PNG (like this?), that’s what I have been trying to figure out for my workflow. Would you mind sharing your progress on that? I have been using the 3D models with the image directly projected onto the UVs.
That works flawlessly with ortographic or frustrum camera but I would like to have horribly unoptimized models in blender and just send the images into the Godot without much care.
Hi there! Sorry I’ve been a little bit busy over the weekend, but I (think) I have finally settled on a workflow! Its a (longish) explanation, so if I ever get time within in the next few days I may just make a video on how I did it. But in the mean time, this is what I’ve got:
Before you get started you need to already know the following:
*Interactable Objects that are not part of the background
*Basic Layout
Make the environment within Blender exactly how you want it to appear in Godot. Separate out any objects that will be in the foreground, as well as any objects that can move/be removed/picked up what-have-you.
When you are finished, you are then going to Render Images out of it in the aspect ratio of your game. Important set your camera to FOV instead of MM, and take note of the FOV number, as well as the rotation of the camera. You’ll need it for Godot. You are likely going to need to take 2 rendered images as you will need the background, and foreground.
For me that was 4:3. I always made the PNGs 2x to 3x larger so that I can make them smaller if necessary for scaling with the player.
In Godot, your scene needs to be set up with:
*Node3D as main Scene
*World Environment with Sky mode and use the procedural sky.
*CSG box for the floor, walls, and collisions.
*Sprite3Ds for every angle
*Either a singular camera with Node3D for position, or multiple cameras. If you want a more in depth explanation on camera swapping let me know.
Use your PNG for the Sprite3D’s texture and set your camera to Perspective, and set its FOV to match Blender’s. From here, you just need to adjust the angle of the sprite3D to whatever angle you used for the camera in Blender, and the camera also needs to have the angle adjusted to match. Fiddle around using the player character as a guide.
Add another Sprite3D for the foreground and set it to No Depth Test in the Flags tab.
After that, just use invisible CSG boxes for all of the collisions.
And There you go, bob’s your uncle. You can swap between cameras by using an Area3D node and once your players enter it, just swap the camera. Note: that any interactable object will need to be exported from blender and adjusted as well. It will look very different from your background though.
It is helpful (at least for me) to upload the entire environment (low poly and basic) into Godot for gameplay testing purposes and to work out what angles I need, what needs to be in the foreground, and what models need to be separated. When I’m finished, I just delete the model. Like @pennyloafers mentioned, you can set cameras as children of the empties to make this process faster during testing.
@ohmygiggles How do you know the distance of collidable objects?
If you put all collidable objects in one layer, that just doesn’t work. Do you render every object separately and assign that PNG to Sprite3D, then put that Sprite3D at the right distance in front of a CollisionShape of the object?
I would just like to know how you handle distance of objects in your scene? Thanks.
Hi there! Sorry for the delay, had some personal business going on so I had to step away for a while. (including losing the entire game file containing all of the work I’ve done for the prerendered scenes)
Any object can be interacted with (as in it moves) is rendered separately (textured and all) and then placed into the scene at the distance and angle that is appropriate. You will need to have your game up so that you can adjust it accordingly. Similar to how you would set up the player character for angles and distance.
As for all other collisions, you would just use a static body or CSG and then place them into the scene where your character should be colliding. The only bodies that have any textures or visibility are whatever agents can move. Everything else is just an invisible box. You only need to make extra PNGs if that object needs to appear in front of the player. Your PNGs are what is doing the heavy lifting, visually. The goal is to essentially make a stage play that runs off of layers (within the scene).
I’ve included a link to a video that shows the theory I’m going off of:
Please let me know if that answers your question, or if I misunderstood, or if I was unclear. I’m back so I can answer your questions much more quickly.
I would suggest using version control system, like git, to prevent future loses, if you’re not already using it.
I managed to get it working with adjusting all Sprite3D nodes in layers considering player’s layer and that’s it.
Thank you for mentioning Sprite3D method and answering my question. I tried doing this with depth texture shaders and UV projection but none of these methods satisfied my requirements and mostly didn’t work.
Thanks! I’ll definitely look into git. Many a tear was shed lol.
I’m sorry wasn’t able to find a solution for you. But hey, if you found a better method would you mind explaining how you did it for other folks that may be looking for the same?
Basically I did sorting via configuring Sprite3D → VisualInstance3D → Sorting → Offset for every object in the scene considering player character’s layer. You just have to play with it because not all scenes and camera angles are the same.