Twitter  Facebook  YouTube  E-Mail  RSS
The One Man MMO Project
The story of a lone developer's quest to build an online world :: MMO programming, design, and industry commentary
Terrain Detail Models
By Robert Basler on 2018-03-25 02:03:28
Homepage: onemanmmo.com email:one at onemanmmo dot com

I coded the shader for ambient occlusion on Friday all hopped up on cold medicine, so I'm really looking forward to seeing what I get on Monday. Ambient occlusion adds dark areas in crevices where the ambient light from the sun has trouble reaching. This helps anchor vehicles to the terrain by making a dark area under them, and I'm hoping it will help sell the new rock formations by enhancing the lighting in crevices. I'm implementing SAO which apparently gives good results and fast performance.

Thursday I finished the micro-prop system which places tiny detail models (rocks, sticks, tires etc.) on the terrain near the camera.

Figuring out which details go where is controlled by the same system that textures the terrain, and the layout of the individual detail models is done the same way as the rock formations, so all that was really easy.

The challenge with microprops was that Miranda needs to draw approximately 11,000 instances of a small number of models. The models are small (under 50 vertices) but that would be a lot of draw calls (which are slowish.)

To speed up the rendering, Miranda groups the micro-props in 80x80m blocks then combines all of the draws into one draw call. Normally the way you would do this is to position each model by transforming each model's vertices on the CPU using matrix multiplication. However that's a lot of math to do. Fortunately I found a better method. When I combine all the models, I add a third texture coordinate which is an index into a 4xN floating point texture containing the transformation matrix for each model. That way the matrix multiplication can be done in the vertex shader which it turns out is very fast. I also combine all of the model's textures into a single texture so there are no material changes. Building the render data is done on a thread and takes less than 100ms in a debug build, so I expect the release build to be at least twice as fast.

The final touch on the microprops was to make them fade in as you get nearer rather than popping into view. Instead of rendering them with translucency (which is problematic) I copied an idea I saw in The Elder Scrolls Online: Screen-door transparency. It works really well.

I haven't said specifically what the next update is going to be. The goal is a significant visual upgrade for Miranda - something that will give my PR efforts some traction and bring in more players. The shroud has already been upgraded. I also added rock formations which make the terrain much more visually interesting while making it immediately obvious where tanks can drive, and where players should set up a base. I also did the prep work for new high-resolution terrain textures. I still have a couple more render tech upgrades planned, then I'll be putting effort into some new art. Lots to do!

New Comment

Cookie Warning

We were unable to retrieve our cookie from your web browser. If pressing F5 once to reload this page does not get rid of this message, please read this to learn more.

You will not be able to post until you resolve this problem.

Comment (You can use HTML, but please double-check web link URLs and HTML tags!)
Your Name
Homepage (optional, don't include http://)
Email (optional, but automatically spam protected so please do)
What color is the ocean? (What's this?)

  Admin Log In



[The Imperial Realm :: Miranda] [Blog] [Gallery] [About]
Terms Of Use & Privacy Policy