09-10-2025, 07:43 AM
(This post was last modified: 09-10-2025, 07:48 AM by josemendez.)
Hi,
Turn out this is a bug in URP 12.1 (I've been unable to reproduce it more recent Unity/URP versions).
Good news is that it can be worked around, replace \Obi\Resources\ObiMaterials\URP\Fluid\AccumulateTransmissionURP.shader with the one I'm attaching, that should solve the problem.
Now I'll explain what the problem is. The bug in particular is this one, which for some reason has been marked as "won't fix" by Unity. Looks like they tried on 2022.3, possibly with a newer URP version so they were unable to reproduce it:
https://issuetracker.unity3d.com/issues/...tom-shader
It's consistently reproducible on 12.1 though. Using Unity's Frame Debugger I could see that in the URP 12.1 project, _BlitScaleBias has a value of 0,0,0,0, when it should be 1,1,0,0:
![[Image: xtjgRGG.png]](https://i.imgur.com/xtjgRGG.png)
Testing on newer URP versions however, _BlitScaleBias always has a value of 1,1,0,0, and the fluid's color buffer is rendered correctly:
![[Image: AVmuEbN.png]](https://i.imgur.com/AVmuEbN.png)
URP uses_BlitScaleBias to calculate the UV coordinates during full screen passes performed by the Blitter.BlitCameraTexture function. The calculation goes like this:
float2 DynamicScalingApplyScaleBias(float2 xy)
{
return _BlitScaleBias.zw + xy * _BlitScaleBias.xy;
}
When URP fails to set _BlitScaleBias it has a value of all zeroes, so the UVs returned by this function are also 0. As a result the fluid screen pass samples only the bottom-left pixel of the screen, which in the fluid's case is white when there's no fluid being rendered at the bottom-left corner of the screen. As a result, fluid has no color because URP reports the screen as having no fluid, which is incorrect.
The patched shader file attached to this email entirely skips URP's internal uv calculation and performs its own correct calculation. This should yield correct results.
let me know if I can be of further help,
kind regards,
Turn out this is a bug in URP 12.1 (I've been unable to reproduce it more recent Unity/URP versions).
Good news is that it can be worked around, replace \Obi\Resources\ObiMaterials\URP\Fluid\AccumulateTransmissionURP.shader with the one I'm attaching, that should solve the problem.
Now I'll explain what the problem is. The bug in particular is this one, which for some reason has been marked as "won't fix" by Unity. Looks like they tried on 2022.3, possibly with a newer URP version so they were unable to reproduce it:
https://issuetracker.unity3d.com/issues/...tom-shader
It's consistently reproducible on 12.1 though. Using Unity's Frame Debugger I could see that in the URP 12.1 project, _BlitScaleBias has a value of 0,0,0,0, when it should be 1,1,0,0:
![[Image: xtjgRGG.png]](https://i.imgur.com/xtjgRGG.png)
Testing on newer URP versions however, _BlitScaleBias always has a value of 1,1,0,0, and the fluid's color buffer is rendered correctly:
![[Image: AVmuEbN.png]](https://i.imgur.com/AVmuEbN.png)
URP uses_BlitScaleBias to calculate the UV coordinates during full screen passes performed by the Blitter.BlitCameraTexture function. The calculation goes like this:
float2 DynamicScalingApplyScaleBias(float2 xy)
{
return _BlitScaleBias.zw + xy * _BlitScaleBias.xy;
}
When URP fails to set _BlitScaleBias it has a value of all zeroes, so the UVs returned by this function are also 0. As a result the fluid screen pass samples only the bottom-left pixel of the screen, which in the fluid's case is white when there's no fluid being rendered at the bottom-left corner of the screen. As a result, fluid has no color because URP reports the screen as having no fluid, which is incorrect.
The patched shader file attached to this email entirely skips URP's internal uv calculation and performs its own correct calculation. This should yield correct results.
let me know if I can be of further help,
kind regards,

