Breakdown: Mud and Water of Spintires
Events
Subscribe:  iCal  |  Google Calendar
Cologne DE   20, Aug — 25, Aug
Vienna AT   23, Aug — 25, Aug
Anaheim US   27, Aug — 30, Aug
SEATTLE US   30, Aug — 3, Sep
Vancouver CA   4, Sep — 7, Sep
Latest comments

Hello there, I found your website by way of Google while looking for a similar matter, your site came up, it seems great. I've bookmarked it in my google bookmarks.Also Visit on Best Editing Services

by Servo Stabilizer
2 hours ago

Servo Star is a prominent manufacturer, providing a wide range of Servo Voltage Stabilizers in India and an array starting from 5 KVA to 5000 KVA for residential, industrial and medical use. Website : https://www.servostabilizer.org.in

by Oleg Demchenko
7 hours ago

https://gumroad.com/l/speedCut

Breakdown: Mud and Water of Spintires
16 November, 2017
News

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

avatar