Breakdown: Mud and Water of Spintires
Subscribe:  iCal  |  Google Calendar
7, Mar — 1, Jun
San Francisco US   18, Mar — 23, Mar
San Francisco US   18, Mar — 23, Mar
York US   26, Mar — 29, Mar
Boston US   28, Mar — 1, Apr
Latest comments

Besides, if you'd be involved in project budgeting you would be aware that the costs are growing and using cheap alternatives is inevitable. This is the business. first of all.

If you hate people that can make your life easier and see the threat in everything related to AI then you can hardly call yourself an artist. Rather than a kid who likes to be in a comfort zone.

This is sad only for cheap projects and artists having no desire to grow. This technology in particular will make life easier for those who often use photostock services.

Breakdown: Mud and Water of Spintires
16 November, 2017

Pavel Zagrebelnyy has shared an article with some technical details behind rendering of Mud and Water in Spintires:MudRunner, a driving simulation game from Saber Interactive. The developer decomposed some screenshots from the game and then showed how you can recreate mud and water from Spintiers with your 3D tools.

Here is a small piece about mud to get you interested:

Game levels in MudRunner can be up to 1km x 1km in size. They are subdivided into a grid of 16m x 16m blocks. Each block contains a list of plants (trees, rocks, etc.), base terrain data, mud data (optional), and other data. Game only draws those blocks that are inside camera “frustum”. Only those blocks that are near the truck that player is driving are “active”. Game only performs plants physics simulation, mud simulation and water simulation for “active” blocks.

The mud simulation consists of mud-vehicle physics processing (performed by CPU) and rendering of the mud (performed by GPU). For a number of reasons (CPU and GPU are out of sync on PC, high detalization required for rendering is not required for physics, etc..), those two tasks operate on completely different sets of data. We won’t go into details of physics here, but in short, there is no rocket science involved, but it’s not something Havok (physics engine in MudRunner) can do out of the box.

In order to draw the mud, vertex shader takes in a simple 2d grid of vertices, then fetches two A8R8G8B8 textures that look like this:

Texture 1. 25×25 in size for each block, is used for rendering both low-res base terrain and the high-res mud.

R (red) channel – packed height (elevation). It is unpacked into real-world height with a bit of math.

G (green) channel – grass/dirt materials mix factor. Currently, each block can only mix 2 materials.

B (blue) channel – “tint” factor. Tint adds some color variation to the environment, and illustrates physics properties (“tinted” terrain is softer).

A (alpha) channel – marks portions of base terrain that are substituted by the mud, it’s the only channel that is dynamically updated as vehicles deform terrain.


Texture 2. 128×128 in size, is only allocated for blocks with mud.

R (red) channel – “mud height”, is relative to elevation of base terrain. It gets unpacked into a floating point value with a simple multiplication.

GB (green, blue) channels – used for “mud offset” effect (the mud slides away from vehicles wheels as they move).

A (alpha) channel – “mud tracks”, a blending factor of terrain shader into mud shader, In combination with A channel of Texture 1 that makes mud transition into terrain unnoticeable.

Pavel Zagrebelnyy 

You can find the full breakdown on Gamasutra

Source: Gamasutra

Leave a Reply