Matthew Wilde
@skilful.bsky.social
2.7K followers 270 following 40 posts
Visual Effects Developer at Valve
Posts Media Videos Starter Packs
Pinned
I do often tend to work on liquidy things - this was the water test we did at Campo Santo pre Valve move
Liquid shader is back for the CS2 charms, this time with not-fake physics and not-fake refraction!*

*it's all fake, it's a videogame
The Grandaddy show in Seattle last night, they had a slideshow of old photos taken from various places on tour mostly. The headline got a chuckle from the audience when it popped up. It was followed by a cool horse.
You should check out this new game @counter-strike.net prettyy good
I hope this was interesting, it's nice when people take an interest in how things are made. There are lots of little ideas and solutions that go into this kind of thing and it's really fun to work with the awesome people at Valve to make it happen.

p.s. we're always hiring www.valvesoftware.com/en/
Valve Corporation
We make games, Steam, and hardware. Join Us.
www.valvesoftware.com
I don't really have anything to add about the bottle shader but do check out @doomquasar.bsky.social 's video if you haven't seen it!
www.youtube.com/watch?v=9XWx...

The CS2 version is pretty much the same, although the physics/not physics is done a bit differently.
The caustics from the interactions come from sampling the buffer again, this time reprojected to fit the underwater geometry from the direction of the sunlight. It has its limits and the fade happens when you approach the edge of the buffer. It's also refracted in the same way as the frame buffer.
The blue channel was originally just to add silt being kicked up but ended up used for more general long-lasting interations. It's used to carve out a path in the surface debris and the normal derived from this channel allows us to push the UVs apart a bit so it feels like you're moving it around.
The green channel is used to define where foam should be and is combined with other textures to make it look more detailed than the buffer can handle by itself (although I wish this looked better to be honest).

You can also see here how the red channel perturbs the UVs to give it a parallax effect.
interaction buffer showing where foam effects will be drawn the foam as it's drawn, a combination of the interaction buffer and other textures
The red channel's ripples become normals and are combined with ambient normals along with those from the surface debris and a little from the foam shape too (as we're calculating it anyway). These are then used for the lighting, reflection and refraction effects in the shader.
combined normal mapping on the surface of the water
Exactly as stated, the red channel is used for waves/ripples, green for foam, blue for softer and longer lasting interactions. The buffer is sampled directly in the water shader - 3 times for the surface so we convert the channels to normals too.
The buffer is smaller still on lower settings. The reason it's not shrunk the same in both dimensions is we noticed the limitation of where it starts to look too blocky happens sooner in the vertical due to the foreshortening you usually get when looking out horizontally across the plane.
Buffer size is ¼ of the horizontal and ½ of the vertical screen resolution.

Red channel is used for waves and caustics.
Green channel is used for splashes and foam.
Blue channel is used for dust and trails on mud/junk on the water surface.

Everything is rendered using flat 2D textures.
Some of the multichannel textures were split for viewing purposes, some were desaturated or cropped.
Interactions are where particle effects would tend to be anyway. E.g. when a character intersects the water plane a particle system is spawned containing both the splashes (normal particles) and the water interaction (water plane oriented interaction effects).
This is a great thread @hillsguy.bsky.social, I'll add a bit more context here for anyone interested.

Yes there's no fancy sim - it just uses a water interaction buffer as a target for the particle system rendering, so we could use the power of particle system we already have.
Decided to check out how water is rendered in Counter-Strike 2.

Given how interactive water in CS2 is, I expected to see some cellular fluid simulation, but turns out they just use a low-resolution off-screen buffer with flat 2D decals used for various aspects of water. Reminds me of HL2 water :)
My cat tree has fruited! Does anyone know if this plump beauty is ripe for the picking?
Cat tree with plump orange cat fruit
Munoz on -1 for a double game week though
The hardest chance. Phew!
8 goals now so far and 1 assist 😭
How's it going on twitter sorry the everything app sorry twitter
It might also be the Harold Shipman beard. Hope you're well mate!
Genuine question @dominos-pizza.bsky.social : Is that stuffed crust or classic?
I'm not even sure where I got that picture. This was the early 90s, it's not like today where people are accustomed to being able to Google pictures of Peter Beardsley's cock and balls whenever they want
Clearing out my parents house which isn't much fun, but it was heartwarming to see my mum kept hold of the t-shirt I made with Peter Beardsley's cock and balls hanging out
Badly home made t-shirt featuring a transferred photo of 80s footballer Peter Beardsley with his cock and balls hanging out Honestly if you can't see this I envy you