Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shader error with Obi 5.5 & URP
#1
Hi there,

I've been trying to upgrade my Universal Render Pipeline project running Unity 2020.1.2f1 to version 5.5 of Obi Fluid.

However, it's giving me the following error with one of the shaders when I assign the Obi Fluid Renderer Feature to the forward renderer:
Code:
Shader error in 'Obi/URP/Fluid/FluidShading': unrecognized identifier 'sampler2D_half' at Assets/Obi/Resources/ObiMaterials/URP/ObiFluidsURP.cginc(13) (on d3d11)

I've tried making a new URP project just to be sure, but I'm running into the same error.

If someone could help me figure out what I'm missing I'd be forever thankful! Sonrisa
Reply
#2
(03-09-2020, 12:58 PM)sushi Wrote: Hi there,

I've been trying to upgrade my Universal Render Pipeline project running Unity 2020.1.2f1 to version 5.5 of Obi Fluid.

However, it's giving me the following error with one of the shaders when I assign the Obi Fluid Renderer Feature to the forward renderer:
Code:
Shader error in 'Obi/URP/Fluid/FluidShading': unrecognized identifier 'sampler2D_half' at Assets/Obi/Resources/ObiMaterials/URP/ObiFluidsURP.cginc(13) (on d3d11)

I've tried making a new URP project just to be sure, but I'm running into the same error.

If someone could help me figure out what I'm missing I'd be forever thankful! Sonrisa

Hi there!

The culprit is one obscure, undocumented "feature" of SRPs: Instead of the usual sampler2D_<precision> syntax for declaring texture samplers in a shader, URP uses custom macros that change the underlying type depending on the graphics API being used. As a result the fluid shaders will work out of the box in all APIs except for D3D11. See: https://forum.unity.com/threads/unrecogn...st-6267078

This will be fixed in the next update. For the time being there's an easy workaround: Open ObiFluidsURP.cginc and replace all instances of sampler2D_half and sampler2D_float with sampler2D.

Let me know if I can be of further help!
Reply
#3
(03-09-2020, 01:04 PM)josemendez Wrote: Hi there!

The culprit is one obscure, undocumented "feature" of SRPs: Instead of the usual sampler2D_<precision> syntax for declaring texture samplers in a shader, URP uses custom macros that change the underlying type depending on the graphics API being used. As a result the fluid shaders will work out of the box in all APIs except for D3D11. See: https://forum.unity.com/threads/unrecogn...st-6267078

This will be fixed in the next update. For the time being there's an easy workaround: Open ObiFluidsURP.cginc and replace all instances of sampler2D_half and sampler2D_float with sampler2D.

Let me know if I can be of further help!

Fantastic! That took care of it, and it's now working perfectly!

Thanks so much for the prompt response! Gran sonrisa Corazón
Reply