Shader error with Obi 5.5 & URP - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Shader error with Obi 5.5 & URP (/thread-2464.html) |
Shader error with Obi 5.5 & URP - sushi - 03-09-2020 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! RE: Shader error with Obi 5.5 & URP - josemendez - 03-09-2020 (03-09-2020, 12:58 PM)sushi Wrote: Hi there, 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/unrecognized-identifier-sampler2d_half.955512/#post-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! RE: Shader error with Obi 5.5 & URP - sushi - 03-09-2020 (03-09-2020, 01:04 PM)josemendez Wrote: Hi there! Fantastic! That took care of it, and it's now working perfectly! Thanks so much for the prompt response! |