Sunday, March 11, 2018

Where to start when building a 3D terrain editor?



I'm looking to build (for start) a simple tool, that could raise, lower, smooth and texture the terrain.


So, what are the things I have to go through in order to make such terrain editor?


And maybe there are valuable resources available on subject?


Yes, forgot to mentioned, that I'm interested in a 3D terrain editor.




Answer



For a 'classic' 3D terrain editor, the steps could be those:


Generate a mesh (e.g a grid of squares, every square made of two triangles), all vertices are shared between triangles (so that there is only one normal per intersection). enter image description here


This should be made a 3DMesh and rendered in your program.


Make a tool to raise and lower (smaller and bigger) parts of the grid (you need to calculate where on the mesh the mouse cursor is and modify the meshes vertices, but only up and down).


Create a big texture (like 1024x1024x4 or better) and texture it with what is called a splat-map: enter image description here


Make it possible to paint it (with R,G,B OR Alpha, not pink for example) and to choose textures replacing those ugly primary colours (Red,Blue, Green, Alpha), or moreover, be represented by them:


The shader (that you will need to create) should multiply those nice textures (say stone, grass, ...) with the intensity in the splatmap (the ugly one) and then mix together the whole so it looks, for example (with like only 2 colours), like this: enter image description here


Sorry for the big images, I whipped together this at work...


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...