Forward, Forward+ and Deferred
Puddlecraft works in all three of URP's rendering paths, so there's no need to pick one for its sake. What changes between them is where the wet surface gets computed, and how much of it screen-space effects can see.
Shading mode
The Puddlecraft renderer feature's Shading (PuddleShading) works the same in every path:
- Overlay (default) draws placed puddles over the finished opaque image, on any material. It reads the depth texture, which the feature requests from URP. Because the placed puddles aren't in the G-buffer or the camera normals texture, they reflect reflection probes, not screen-space reflections.
- Materials leaves everything to your materials: Puddlecraft/Lit (Wet), the puddlecraft-wetness Shader Graph node
or the
PuddlecraftWetnessHLSL function. Wet ground, procedural puddles and placed puddles merge into one. See Wet Ground & Materials.
Deferred
In Deferred, Puddlecraft/Lit (Wet) works out the wet surface once, in the G-buffer pass. The darker albedo, the higher smoothness and the water's normal (ripples and rain rings included) go straight into the G-buffer.
So everything that reads the G-buffer sees the puddles for free: URP's lighting, reflection probes, and any screen-space reflections that read G-buffer smoothness and normals. That makes Deferred the cheapest path for wet materials when the scene uses screen-space reflections.
The G-buffer pass needs shader model 4.5 and isn't compiled for OpenGL, same as URP's own Lit shader. URP falls back to Forward there.
Forward and Forward+
In Forward and Forward+, Puddlecraft/Lit (Wet) works out the wet surface in the forward pass, while it's being lit. Forward+ needs no extra setup: the material, the rain and the water features all support its clustered lights.
There's no G-buffer here, so screen-space effects read URP's camera normals texture instead. It's drawn in a depth-normals prepass whenever something asks for it (SSAO, or a screen-space reflection add-on). By default, Puddlecraft/Lit (Wet) draws the dry, normal-mapped normal there with an alpha of 0, exactly like URP's own materials. For SSAO, that's what you want.
Screen-space reflections are where it gets interesting. If you want the street reflected in the puddles, turn on Wet Normals on the renderer feature (wetNormals). The prepass then draws the wet normal, ripples and all, and writes the smoothness into the normals texture's alpha (the way HDRP's normal buffer carries roughness). A reflection effect can read the smoothness from there, just as it would from the G-buffer in Deferred.
The cost: whenever the prepass runs, it now works out the wet surface too, which is about as much again as the wet material itself. Without screen-space reflections, leave it off.
Materials built with the Shader Graph node get the wet normal in the prepass whatever Wet Normals says, because URP's Shader Graph prepass evaluates the graph's normal output. They don't write smoothness there, though.
What it costs
A downpour at High quality in the demo scene, 1920×1080, measured on an RTX 3070 Laptop with screen-space reflections on. Everything Puddlecraft draws, at 60 fps:
| From above the square | At eye level in the street | |
|---|---|---|
| Deferred | 0.42 ms | 0.35 ms |
| Forward+, Wet Normals on | 1.07 ms | 0.85 ms |
| Forward+, Wet Normals off | 0.98 ms | 1.10 ms |
Deferred comes out cheaper for two reasons. The wet surface is only worked out once, and screen-space reflections get about half a millisecond cheaper where the ground is wet and smooth. In Forward+ with Wet Normals on, that saving offsets most of the prepass's cost (about 0.4 to 0.5 ms here). With it off, the reflections don't see the puddles, so they don't get any cheaper either.
These totals wander by about ±0.15 ms between runs.
Choosing
- Deferred if you use screen-space reflections and want them in the puddles. It's the cheapest, and needs no setup.
- Forward+ for many lights, MSAA or transparency-heavy scenes, or when the project already uses it. Turn on Wet Normals only if a screen-space reflection effect should see the puddles.
- Forward for small scenes and lower-end targets. The same rules as Forward+ apply.
- Without screen-space reflections, puddles reflect your reflection probes in every path.