logo80lv
Articlesclick_arrow
Research
Talentsclick_arrow
Events
Workshops
Aboutclick_arrow
profile_loginLogIn

Breakdown: Mud and Water of Spintires

Pavel Zagrebelnyy has shared an article with some technical details behind rendering of Mud and Water in Spintires:MudRunner.

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

A set of 256 SF trim brushes for ZBrush, all brushes use 2048x2048 16bit alphas and PSD, Tiff, Jpeg alphas are also included.

Error
(2000-0001)

Join discussion

Comments 0

    You might also like

    A Week After "Basically Announcing" Minecraft 2, Notch Basically Cancels It

    Instead, he and his team will focus on the previously-announced retro-style roguelike.

    Discord Gets Sued Over Alleged Anti-Consumer Practices

    The plaintiffs claim the platform has intentionally made it overly difficult to cancel subscriptions.

    Rumor: Possible Release Date for Grand Theft Auto 6 Revealed

    A video game store from Uruguay appears to have disclosed the launch date for the gaming industry's most anticipated title.
    • Metal Damage VDM Brush
      by Nicolas Swijngedau

      40 hand sculpted metal damage brushes all contained within one Multi-Alpha brush. Perfect to speed up your armors creation!

      Error
      (2000-0001)
    • Insectoid Creature Brush mega Pack
      by Nicolas Swijngedau

      80 insectoid creature mega pack to create a variety of insects and alien creatures in the blink of an eye! Mandibles, horns, limbs, and all the little bits to bring your bugs to life! Just load the brushes, drag them into your scene and you're ready to go!

      Error
      (2000-0001)

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more

    ×