0
$\begingroup$

I am trying to render an Isometric scene for a game project. I also want to include depth / normal information so I can do some dynamic lighting in the game world in real-time.

Goal

So I have a 3D blender scene; I need to bake a cycles render of this scene into a 3D mesh that I can import into the game scene and will allow me to apply some dynamic lighting from within the game engine I import it into.

My Attempt

To do this:

  1. I render a 3d scene into three different textures, with the camera in orthogonal isometric perspective. Using the Blender Compositing Nodes, I produce the following 2d images:

    • 2D color texture
    • 2D Normal Map
    • An OpenEXR depth texture (distance from camera basically)
  2. Then, I open a new blender scene and add a 2D plane with many many subdivisions. Then I apply the above textures onto this plane. This produces a deformed plane like seen below: enter image description here This is a 2D plane, deformed by the Depth Map, not the original 3D scene.

  3. The idea is, that I can rotate this mesh such that the ground aligns with the game world's 2D surface plane, and navigate it like a normal 3D scene with lights / characters. Using an orthogonal perspective, this will look like the isometric scene rendered in step 1, except I can apply dynamic lighting etc.

The Problem

There are really two problems with this approach that I have run into. Both are related to the faces seen in the below image (highlighted) enter image description here

  1. Lighting wont pass through these walls, which isn't a huge issue since I can probably find a way around that.

  2. Those faces, while in theory should not be visible, due to the resolutions constraints on subdivisions of the plane, that are slightly visible in an orthogonal projection. These faces slightly overlap entities behind the front-facing faces of the object (for example, if I had a character standing behind the cross) and creates a border effect for the cross. See below picture:

enter image description here

Is there any way to either solve these problems, or maybe a better approach I can take to achieve the above goal?

Thanks!

$\endgroup$
  • $\begingroup$ Welcome to Blender Stack Exchange! Why did you choose to use a displacement and normal map instead of just using the original models? I think the best way to make an isometric game world would be to keep the original scene and use the game engine to make it look isometric. $\endgroup$ – Brenticus May 11 at 19:57
  • $\begingroup$ Hello @Brenticus Thanks for your response! :) I want to render the scene in cycles if that is possible. My reasoning is that this will produce a higher quality render than what the game engine can produce in real-time. So I guess the idea is that I can bake a lot of the material / mesh rendering. Not sure if makes sense what I am doing? Maybe it isn't a good idea? The idea is this would work well in a browser game etc, where I dont want to hog up a lot of the host resources for holy-poly mesh rendering? $\endgroup$ – user96203 May 11 at 20:22
0
$\begingroup$

I think you should approach this a different way.

Using a displacement map to generate your whole world probably isn't a good idea. It will actually lead to lower quality and worse performance.

When making a game, the usual process goes something like this:

  1. Make individual models (assets) for the game. This would mean things like houses, trees, walls, etc. would be individual objects. I would imagine that is how you made your scene initially.
  2. Add materials to these objects. When you export a model to a game engine from Blender, the only information about how the objects look is stored in an image texture. Thus, anything that can't be stored in an image texture (fog, glowing objects, anything that has to interact with the world in real-time like a reflection, etc.) usually shouldn't be done inside Blender, at least not in the way that you'd normally set these things up in Cycles.
  3. Export the individual assets with their textures to a game engine, and build/rebuild the world in the game engine.

When making the individual assets for a game, there is a general process that is usually followed for this too. I'll use a house as an example since you have one in your scene.

  1. Start by making the 3D model. If your goal is to make the house as realistic as possible in the game, you would make a very detailed house model in Blender. If you're not going for really high detail, you can make the house with less modeled detail in Blender. This can still give really good results too.
  2. Texture the house, using whatever methods you want. You can use image textures, procedural textures, whatever it takes.
  3. If you made the house with more modeled detail than you think the game engine can handle, at this point you would "retopologize" the house, meaning making a lower detail version based on the high detail model.
  4. Bake the various kinds of detail into image textures. I think this is the step that will help you the most. Cycles has a bunch of options to bake detail, including normals, roughness, color, shadows, and many more. These settings are all found at the bottom of the Render Properties tab (the Camera icon) on the right side of the screen. If you have a high detail and low detail model, you can bake the normals from the high detail model to the low detail model, making it look like it has more detail than it actually does.
  5. Once you have an individual object made, with as little modeled detail as possible, and you have all the textures that you need for that object, you would import it into the game engine. This process can vary depending on the engine, so if you need more information on how to do that I would look up tutorials or other information on the specific game engine.

I mentioned that using a displacement map will give you a lower quality result, so I'll explain that a bit more.

Let's look at a simple cube. A modeled cube has only 6 faces, which will be converted to 12 triangles when rendered. No matter how close you get, the faces will appear perfectly flat, and the edges nice and clean. If you use a displacement map, you will need a very dense mesh to displace to get even close to the same amount of definition. If you wanted to a get an edge that appears perfectly straight and sharp, you would actually need a mesh that is so dense that each face ends up smaller than a single pixel. Otherwise you would get jagged edges, rounded edges, weird faces on the edge, or other issues. For certain things displacement maps can be great, but in general, a properly modeled and textured object can be more detailed with less faces.

If your concern is realism while keeping it easy to render, I would look up more information on modelling game assets, baking details such as normals, and how to setup game worlds using whatever engine you choose.

I know there's a lot of information here, and this still isn't a perfect guide to making games, but it should give you enough to get you started and help you find more information.

Hope this helps!

| improve this answer | |
$\endgroup$
  • $\begingroup$ Hello, this helps clarify my understanding a lot! I will try to apply this general approach. I really appreciate the comprehensive answer! $\endgroup$ – user96203 May 11 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.