Wagner
June 14, 2024, 10:31am
1
Hello everyone, I present my implementation of a terrain for the Playcanvas.
Ability to save and load height maps.
The system uses a smart solution and automatically determines which patches need to be hidden and detailed.
Integration with Ammo, using dynamic meshing based on logs.
9 Likes
Great! Any plans for texturing?
1 Like
Wagner
June 14, 2024, 11:50am
8
Yes, I’m already developing it.
2 Likes
Wagner
June 20, 2024, 2:33pm
11
Upgrade: Add support texture painter, support 8 channels. Save to special file format or png.
3 Likes
Wagner
June 29, 2024, 8:06pm
12
Upgrade:
Added support for rectangular side shapes.
Optimization vram use.
Example: terrain 16x16km.
WebGL2
WebGPU (use baseVertex)
The distances and the map itself are so large that the sky box cuts off the map.
Terrain: 1x1km width scale 8 = 8x8km.
@mvaligursky
3 Likes
Wagner:
baseVertex
@Wagner - feel free to create a PR for the baseVertex on WebGPU.
1 Like
Wagner
September 16, 2024, 12:42am
14
The video shows a map with the original size of gta 5.
Improved algorithm and optimized memory usage for webgl. Map size 16x16 uses 34 MB for indexes and 269 MB for vertices.
1 Like
ALUCARD
September 16, 2024, 3:31am
15
So is this a plane with a bunch of premade subdivisions or is it a regular plane that is subdividing itself on the fly as needed?
ALUCARD
September 16, 2024, 3:33am
16
Also were you planning on making this code publicly available or sharing it in any way?
Wagner
September 16, 2024, 9:33am
17
The algorithm is based on geomipmapping.
I have been doing research for a long time which algorithm is better to use quadtree, voxel, geomipmapping.
Optimizing the structure to use video memory, etc.
Some approaches cannot be used due to limitations of WebGL2 or WebGPU.
3 Likes
ALUCARD
September 16, 2024, 8:48pm
18
Might i ask what specs are required to run something like this?
Wagner
September 16, 2024, 9:11pm
20
For browser development I use MSI GE 60 laptop,
RAM: 8GB, DDR3
GPU: nVIDIA Geforce GT650M 3D,
CPU: Intel Core i5-3210M (Ivy Bridge)
You should clearly understand that this type of landscape is suitable exclusively for games with a huge open world, like DayZ, WarZ. Because if you use less landscape, it will be cheaper to use a baked model.
Example: Terrain Generation from Heightmap | PlayCanvas Developer Site
1 Like
ALUCARD
September 16, 2024, 9:13pm
21
Is the subdividing based on rounding various values or just by location? What I mean is a scenario where point 1 has a height of 0, point 1.25 has a height of 5, point 1.5 has a height of 30, point 1.75 has a height of 5, and point 2 has a height of 0. Would the height of 30 be used in some calculation or just overwritten with a flat plane from 1 to 2?
Wagner
September 16, 2024, 9:19pm
23
The division occurs at the level of x, z coordinates.
Height is of secondary importance.
Read more about geomip mapping / quadtree.
ALUCARD
September 16, 2024, 10:06pm
24
So if there was a really tall spike in between two coordinates it would just get ignored.
ALUCARD
September 16, 2024, 10:08pm
25
Sorry if my questions are annoying, this is just quite new to me. Would it be possible to have overhangs?
Wagner
September 16, 2024, 10:12pm
26
Are you talking about the accuracy of the height map? The whole map is made up of LODs, so when you are in a LOD square, you don’t lose any height.
LeXXik
September 16, 2024, 10:23pm
27
No, overhangs and caves are not supported with this method.
ALUCARD
September 16, 2024, 10:26pm
28
Is there any system like this that would allow for overhangs?