Add support 2.8 version
The ability to place ShadowMap for terrain considering different light sources has been added, with rendering performed using a single cascade, unlike diffuse rendering. This allows for just one draw call, as the system automatically gathers the necessary fragments, taking into account the type of lighting and its AABB, ensuring efficient and fast rendering in a single call.
Hi! I want to use this, but I can’t figure out how to add it to a project. If you could help me that’d be great!
Hi!
Beta: PlayCanvas | HTML5 Game Engine
Project: PlayCanvas | HTML5 Game Engine
Github: GitHub - AlexAPPi/playcanvas-terrain-system: Terrain System WebGL and WebGPU for PlayCanvas
Update:
Now the terrain uses the standard wireframe approach from the engine.
We are close to finishing writing a plugin for the editor.
Huge update:
Within the module’s methodology, a chunk is a part of the height map stored in memory and represents a segment of the landscape. The PatchedHeightMap has been renamed to ChunkHeightMap to emphasize its role as a part of the height map associated with a specific chunk.
-
Transfer AbsPatchedHeightMap to AbsChunkedHeightMap
-
A PatchesSphereBuffer has been added, designed to detect changes in the height map and update the spheres for the frustum accordingly. Thanks to optimizations and a lightweight structure, we have managed to accelerate frustum processing by at least four times.
-
LodManager has become independent of the landscape, and a LodEstimator has been introduced within the landscape to calculate the number of LOD levels needed. Consequently, LodManager is now only required for determining the LOD for a specific point.
-
For LodManager, a LodState has been added, which can control the zFar parameter. Based on this parameter, the LodManager can determine which LOD levels are appropriate for a specific LodState.
-
Now, each LodState can have its own MeshInstance, allowing LodState to be used for different layers (for example, a cascade shadow layer).
-
Now, the combination of frustum culling and LOD management allows for optimal segmentation of the landscape, providing the desired level of detail or fragmentation.
-
A shader example has been added that enables eliminating the need for tile textures in the landscape.
-
Added meshInstance bus, which allows using a single buffer for everything.
Today, we released a small update: now you can use our system to create water height maps. There’s no need to store separate height maps — the height is defined by an equation for each water coordinate, which is especially convenient for games like Crosswind:
This mechanism is also integrated into Ammo.
Public Release 0.0.4b
- For private updates including (roads, trees) please contact me via private messages.
Update:
Added the ability to generate shadows with the ability to control detail.
(ShadowPatchesRenderPreparer, ViewPatchesRenderPreparer)
- Soon, shadow will be controllable for each shadow cascade.
Update:
Fixed the issue of duplicate draw calls, now the landscape rendering takes on average only 19 calls for (CombineInstancingAccelerator) render mode.
Update:
Added the ability to set custom margins for patches in frustum check.
Update:
Grass Rendering Optimization
Key Improvements
- Reduced Memory Usage:
Memory consumption for storing grass data has been reduced by 33% due to a decrease in the number of color channels used. - Color Channel Configuration:
A total of 7 color channels are now available for color data, allowing for more efficient resource utilization. - Enhanced Slope Control:
An example has been added that demonstrates how to control grass rendering on steep slopes, providing greater flexibility in landscape visualization.
Added the ability to control the drawing of blades of grass double or single side
- Single-sided rendering: Grass blades (or the polygons they consist of) are only visible from the front. If you look at a blade from the back, it will be invisible. This saves GPU resources and speeds up rendering because the system does not waste calculations on surfaces that are not normally visible.
- Double-sided rendering: Grass blades are visible from both the front and the back. This makes each blade visible no matter the camera angle. This mode is useful if you expect to view grass from multiple directions, like above and below, or if the blades bend and “open” under wind effects.
** This feature affects only the number of polygons. The cull value of the material is left to the discretion of the developer.
The new update introduces support for grouping grass blades into clusters, allowing the creation of more complex and realistic vegetation structures. This feature enables the formation of grass clusters with individual parameters, making landscape visualization significantly more diverse and natural.
Additionally, a mechanism for the preliminary calculation of parameters for individual grass blades has been added. Now, before rendering, a comprehensive preprocessing of data is performed, the results of which are saved in a special data texture. This provides fast access to the necessary computed values during visualization, optimizing and speeding up the process of displaying complex scenes with dense grass.
Overall, the update offers the following key features:
- Efficient grouping of grass blades into clusters with controllable characteristics.
- Preliminary calculation of complex data for grass blades with storage of results in a data texture.
- Improved performance and realism for procedural generation and rendering of grass.
- The algorithm for determining the AABB for a fragment has been improved: it is now based on finding the patch heights and identifying the highest and lowest points, which allows for more accurate frustum culling.
private _updateMinMaxFromPatches(min: pcx.Vec3, max: pcx.Vec3) {
const width = this._terrain.object.width;
const depth = this._terrain.object.depth;
const heightMap = this._terrain.object.heightMap;
const minX = clamp(min.x, 0, width);
const minZ = clamp(min.z, 0, depth);
const maxX = clamp(max.x, 0, width);
const maxZ = clamp(max.z, 0, depth);
const min00 = heightMap.getEntriesPatchMin(minX, minZ);
const min01 = heightMap.getEntriesPatchMin(minX, maxZ);
const min10 = heightMap.getEntriesPatchMin(maxX, minZ);
const min11 = heightMap.getEntriesPatchMin(maxX, maxZ);
const max00 = heightMap.getEntriesPatchMax(minX, minZ);
const max01 = heightMap.getEntriesPatchMax(minX, maxZ);
const max10 = heightMap.getEntriesPatchMax(maxX, minZ);
const max11 = heightMap.getEntriesPatchMax(maxX, maxZ);
min.y = Math.min(min00, min01, min10, min11);
max.y = Math.max(max00, max01, max10, max11);
}
Notification:
The 2.10.0 version of the engine has become more stable and functional. Therefore, we plan to discontinue support for the first version of the engine and focus the development of the project exclusively on new versions. Support for the first version will continue until 01.10.2025. Please upgrade to the updated version in a timely manner to ensure uninterrupted operation and to receive all the new features.
Thank you!