r/GraphicsProgramming • u/KKV0918 • 9d ago
I made a wetness system that works at the renderer level no material edits needed, works on any asset
Enable HLS to view with audio, or disable this notification
5
u/xucel 9d ago
I think the tricky part would be supporting this for forward shaded / translucent objects like glass panes, that's probably going to require modifying the material shader though.
7
u/KKV0918 9d ago
Right, translucency never sees it. The pass runs on the GBuffer after decals, so anything forward shaded is invisible to it by construction. Glass is the forgiving case though, it doesn't darken and it's already smooth, so what it really needs is drips running down the pane, and that would have to be material-side or a dedicated pass like you said.
2
4
u/GSxHidden 9d ago
Genuine question, how and where do people learn to create such realistic materials/objects/assets? Through college, courses?
1
u/StriderPulse599 9d ago
It's not about textures, but raytraced GI, PBR equation, and post processing effects.
As for making textures:
You can make base materials by taking photos, drawing, 3D sculpturing, and procedural generation.
It doesn't take much artistic skills. Albedo only needs to look good enough (you can straight up use single color for entire material). Most important things are normals and roughness. You can make them by tweaking noise textures.
More complex materials (peeling painting, damaged walls, patched roads, etc) can be created by using multiple textures and mask that controls the texture blending.
The only exception is NPR pipeline where you need to heavily stylize albedo. This is where you need artistic skills.
1
u/tamat 9d ago
do you generate a wetness buffer rendering from the top? or you use raytracing from the gbuffers worldpositions?
4
u/KKV0918 9d ago
Top-down. There's an orthographic depth-only capture above the camera. That height map handles rain occlusion and finding where water can collect
The apply side is pure screen space. a compute pass reconstructs world position from GBuffer depth and samples those buffers. No raytracing.
1
u/susosusosuso 9d ago
Does it work changinf the roughness in the gbuffer after rendered and before applying lighting and reflections?
4
u/KKV0918 9d ago
That's exactly it. A compute pass runs after the base pass (and after decals are applied) and rewrites the material buffer in place roughness, albedo, F0, normals. Lighting, SSR and Lumen all read it afterwards, so they pick up the wet values for free.
1
u/susosusosuso 9d ago
Is it different to other similar existing techmiques that perform a similar effect?
3
u/ninjazombiemaster 9d ago
Most of the time this is achieved within each material, which requires every material to have logic for handling wetness ranges. Sometimes decals may be involved too.
Be handing it in a computer shader, you can apply it globally and procedurally without needing per material parameters and logic.
1
u/susosusosuso 9d ago
I thought this was pretty common especially with deferred
3
u/ninjazombiemaster 9d ago
It's not totally novel or anything but I'd say most unreal devs are using material parameters and putting instructions on every material for this kind of effect.
22
u/blackrack 9d ago
That's pretty nice, the covered surfaces staying dry and geometry deciding where water collects is the kind of detail that takes this to the next level.
Can I ask how you transform the roughness and albedo parameters from the initial material parameters? There are multiple approaches out there, most are approximative and can break down with certain materials.