Convert a glb 3d model terrain into a 2D heightmap, and Optimise bloom effect

Hi, how woudl i convert a glb 3d model terrain into a 2D heightmap for Gdevelop? I need it to be exactly the same as the model.

This is more of a blender question, but none the less, this is how you do it.
Im a little vague on the location of some of these options, but as i know you kinda know blender, i assumed youd be able to find them. If you or anyone else cant, feel free to ask me about any confusions.

Lets say for example you have terrain like this

First, set the cameras position and location all to 0.

Then, set the camera lens type to orthographic.

Now, press the 0 key on your numpad. This enters the camera view of the main camera in the scene.

You should change the resolution to whatever aspect ratio your terrain is, which should be a square. You probably dont need very much detail depending on your use case, so i would suggest 512x512.

Now slide the orthographic scale of the camera until the terrain fits perfectly in the frame.

Materials

Select your terrain and give it a new material.

Open the shader editor on that material, and delete the Principled BSDF shader.
Add a Texture Coordinate node and a Separate XYZ node, and connect “Generated” from the last node and plug it into the Vector of the Separate XYZ node. If you wish to change the fall off from black to white, connect the Z of the Separate node and plug it into a Color Ramp. However its likely fine as is. Instead, just plug the Z output right into the Surface input on the Material Output node.

If everythings right, your nodes should look like this.

Go into the render tab, and change the View transform under Color Management to Standard. Now, press render, and you should have a perfectly functional, top down height map of any model you want.

Works like a charm, thanks a lot! Just a bit laggy in the editor.

Is there a way to have a heightmap that is not a square shape, like erasing the lower flat sections?

I just want the island section in the center.

Editor? gdevelop or Blender? i dont understand

Gdevelop editor. Is there a way to have a heightmap that is not a square shape, like erasing the lower flat sections?

I just want the island section in the center.

no im sorry, thats not possible. But this is better…because if you put a water plane over it, youd have actual bodies of water.

Oh ok. Its just i have an action to scatter on a height map, and I dont want the grass to scatter on the parts that wont be seen and are below ‘sea level’, just want to scatter on the island section.

well, uhm… its seaweed!

hahaha! its not actually the sea thats around, its lower terrain thats different biomes… so wont work…

also, when I use this beautiful bloom effect the fps drops to 10-20 for my laptop, 40-60 for a good PC. any idea how to improve the performance?

…no? i have a super computer, which makes it quite hard for me to optimize. this is difficult cause gdevelop gives you less parameters with the 3d bloom

yeah i was wondering if there was a way to go into the javascript and optimise it or something which im clueless about. What are your computer specs?

i have a M4 mac mini with 16 GB of ram

i apologize that its not specs that are comparable to a pc, but basically the cpu is an integrated cpu, this means the gpu and cpu are on the same chip. in 2024, the best graphics on an integrated chip was the integrated radeon 780M, which still, is 30-40% behind the M4.

My laptop pc which ran from 10-20 fps also has 16 GB ram, and integrated cpu (cpu and gpu same chip) as well, an i7.

The PC that ran (at university) at 40-60 fps was 32 Gb ram+ graphics card as well.

…oof. i might need to rethink over the performance of every game ive ever made. that is unless you showed me your code or something, where there could be something else wrong

your laptop is pretty average specs i would say… i think for my game its mainly the fact i am trying to have millions of grass objects in the scene.

  1. its not a laptop
  2. no

to be clear…your laptop sounds average

oh yes, my laptop is very average. its terrible at rendering this game. Its not a gaming laptop, its not apple, and its not a desktop PC…

tbf… i have no idea what is a good performance for a gdevelop game. any single complicated graphical effect just demolishes the earth, on anything that isnt super powerful