I am testing and wrapping up the terrain system, instancing of the trees, grass and detail objects, after that there must come the editor integration of the terrain, soon new infos.
The usual sneak peek from the techdemo:

El Water Tower
![]() |
Nytro Game Engine Development Blog |
game engine development ramblings |
I am testing and wrapping up the terrain system, instancing of the trees, grass and detail objects, after that there must come the editor integration of the terrain, soon new infos.
The usual sneak peek from the techdemo:

El Water Tower
The vegetation system comes along quite nicely, there can be defined several layers of vegetation objects, for example trees, grass and rocks, no limit whatsoever. Each vegetation layer has 3 levels of detail for its objects, 3D model, 3D impostor and 2D billboard/impostor, the radius around camera and other many parameters are tweakable, so you can make engine profiles for low/medium/high machines, depending on power. The vegetation objects can swing in the wind, in the future the trees or other vegetation objects will be breakable, the problem is a little bit more complex, because it must switch off the instanced object and create a new dynamic/broken one in the scene, but its doable.
Here is a small tease of the terrain and vegetation (the assets are ugly though, no time for that now, only tech)

Vegetation objects

Vegetation 2

Vegetation 3
I have opted for a database of terrain objects, generated positions/colors/scale for each instance from a distribution map and several tweakable parameters, outputs to some instance data file which can be loaded or later on streamed and instances being updated around the camera, when needed. The problem is to find the right instances around the camera radius from lets say 1 million objects (trees, grass patches,rocks,detail objects), of course you cannot search through all them, computing distances for each one, so I figured out that a quad tree will help it, assigning instance index lists to leaves, wrote a generic quad-tree class, which can take user specified callbacks to subdivide and query for data, so you can use it in any quad-tree-worthy feature you might have.
The grass looks good, added layers of grass, basically the terrain can have 3 types of instanced things on it: grass (blades looking at camera, on a radius around the camera ), trees (they have special features, like LOD with impostors, physics, etc) objects ( like soda cans, broken branches, detail objects ), so you can have many layers of these objects on the terrain. More info soon. Posted a small work in progress video:
The terrain has heightfield shapes attached to it so it collides with other objects, or the objects collide with it… Anyway, the terrain is around 20×20 km visible, but can be extended to even 250×250 km invisible/streamed from disk, because you simply add more terrain patches on the fly.
So we have the physics, a simple skybox which will evolve into a scattering solution, cubemap computed on CPU and used on a sphere as skysphere, Mie Rayleigh scattering.
The terrain texturing is now done with 4 diffuse textures, one detail normap map, but I will change it to use texture atlas for diffuse/normal/specular, this way I can have like 10 diffuse textures in one texture (stage), and same for normal and specular, and the splatting will be done in shader, we’ll have to test the performance of this approach, but it is quite appealing.
Next, after the terrain physics, I want to see some nice grass on the terrain, so the grass will be instanced on the terrain using a distribution map: Red will be used to paint grass, Green will be used to paint trees, Blue can be used to paint rocks, Alpha to paint detail objects like broken branches or soda cans.. Each channel can have its procedural parameters, like spacing, rotation,scaling,slope min/max. This system can be extended to use more than one map to generate stuff on the terrain, and you can just do something like: terrain->addDistributionChannel( someMap, CHANNEL_RED, someObjectInstancingInfo );
The grass in particular, will be culled around the camera, inside a radius, and it will fade away using alpha testing (not blending ), the grass will bend in the wind using shader driven motion, and I’ll think how I can add arbitrary forces like ship engines blowing down to the grass or helicopter’s blades. The grass blades will always face the camera, they will not be only vertically locked, actually that can be some flag for a specific channel, some sort of VERTICAL_BILLBOARDING flag.
Pictures/videos soon.
Developing an engine, and a pretty generic engine its pretty hard and can lead you to a point where you dont know why you are developing that feature, will it be really used ? maybe not.. so I have decided to write a game in parallel with the engine development, Eternal 2, “sequel” of the first mini game wrote with Nytro, for some competition, it was a 1-week project, check the video here:
The game will show off flying vehicles, terrain vehicles, drones, landscape / vegetation, sky, and other small things. The development progress will be shown on this blog, on the Eternal2 game gategory. Wish me luck
. More info on story, gameplay, soon.