Terrain Component for Editor

  • The caves can only be made as a separate model, I’m already working on the cuts of the pieces.

You can look at this solution for godot, but do not forget that js works very poorly with numbers, so such algorithms are not very suitable for pure js.

GitHub - Zylann/godot_voxel: Voxel module for Godot Engine.

That link you sent me seems either incredibly broken or outdated. Of the 19 projects, only a single one functions.

Hello everyone, I am opening public access to the beta terrain system for our engine. I hope someone will be interested in working on it together.

4 Likes
  1. Add compressed algoritm for height map.
  2. Add instancing accelerator.
  3. Improved height editing performance.

image
image

1 Like
  • Added the ability to save and import a height map from a file. In the future, I plan to use zip to save space.
  • Add build version on github
  • Add open project: PlayCanvas | HTML5 Game Engine.

3 Likes
  1. Added grass support.
  2. Added a brush for drawing grass, with the ability to fill in color.
  • Work is underway on the road editor.

2 Likes



  1. The grass algorithm has been improved, now the entire field is rendered in just 1 draw.
  2. The brush supports up to 8 color and texture options.
  3. Full compatibility between WebGl2 and WebGPU.
3 Likes
  • Add new method of rendering a model has been developed, at the moment it is experimental.

1 Like

Awesome work my man!

I started working on something similar myself years ago, but you’ve gotten a lot farther than I ever did. I got demotivated by the fact there’s no actual public “asset store” in PC as there is in Unity.

So are you gonna make it free or paid, when can we expect this component out in the public?

This will definitely add a lot of value to PlayCanvas

2 Likes

I don’t have enough time to bring it to something working in the editor itself, at the moment I’m looking for like-minded people in developing this, it’s too early to talk about openness or financial benefits.

1 Like

Add Ammo integration:

  • update heightdata runtime.
  • use 1 buffer is used between Ammo, JS and GPU loader.

.

4 Likes

Wow so cool

At the moment, support for the V2 engine will only be for the current version, earlier versions of the V2 engine will not be supported, this is due to the update of the shader chunks.

V1 support is still supported from version 1.71

    if (engineVersion === 'v2') {

        const normalCoreVS = chunksStore.normalByHeightMapVS + normalCoreVS_V2;
        const transformHeaderVS = transformHeaderVS_V2.replace('%%HEIGHT_MAP_SAMPLER%%', getSamplerType(heightMapFormat));
        const transformVS = definesVS
            + (instancing ? chunksStore.baseForInstancingVS : chunksStore.baseOriginalVS)
            + transformHeaderVS
            + (instancing ? chunksStore.currentTerrainXZForInstancingChunkVS : chunksStore.currentTerrainXZChunkVS)
            + terrainHeightFactorVS
            + chunksStore.terrainCoordsChunkVS
            + chunksStore.terrainChunkBufferCoordVS
            + chunksStore.terrainHeightFactorChunkVS
            + chunksStore.terrainHeightChunkVS
            + transformVS_V2;

        return {
            
            // Vertex
            normalCoreVS,
            transformVS,
            transformCoreVS: "",
            transformInstancing: "",

            // Fragment
            diffusePS: chunksStore.diffusePS,
        };
    }
2 Likes

Improved instance accelerator, now 30% fewer drawcalls are required to render the landscape.

The average call rate dropped from 50 to 34.


@see TerrainPatchesCombineInstancing.mts file

5 Likes

A new parameter has been introduced that allows you to take into account the Y position of the patch to form the lod grid. Previously, this was the default, now you can only take into account the xz distance to the patch.

3 Likes
  1. To optimize calculations, the minHeight property of the height map was removed. (Most often it was equal to 0)

  2. Fixed frustum desynchronization between frames, see Fly Camera script (FlyCamera.mts). Which caused patch display delay when some patches were displayed on the next frame.

...
        // Update the camera's TRS
        this.entity.setLocalEulerAngles(this.ex, this.ey, 0);
        this.entity.translateLocal(this.translateLoc);
        this.translateLoc.set(0, 0, 0);

        // Update frustum by actual matrix
        this.app.renderer.updateCameraFrustum(this.entity.camera?.camera);
...

1 Like

Hi, does this make use of Ammo.btheightfieldterrainshape ? I searched the repo for btheight and did not find any obvious reference/linking to this.

Hi, I wrote my own type for ammo, initially I used Ammo.btheightfieldterrainshape, but since I use various optimizations for storing in the buffer, I had to make my own type.

I’m not ready to release this change to the public at this time.

Due to frequent changes in the engine’s shader base, the integration work into version 2.0 has been temporarily postponed. We need to wait for more stable updates to ensure proper and reliable integration.

1 Like

Open beta test for Ammo integration: