![]() |
Help Obi fluid use 2D light - 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: Help Obi fluid use 2D light (/thread-4237.html) |
Obi fluid use 2D light - seenotevil92 - 05-06-2024 Good afternoon. I'm developing a 2D game. I'm using 2D urp pipeline with obi fluid 7. How can I get 2D light to work with obi (freedom etc)? I tried adding a lit-sprite-shader but it didn't work. RE: Obi fluid use 2D light - josemendez - 05-06-2024 (05-06-2024, 12:38 AM)seenotevil92 Wrote: Good afternoon. Hi, URP 2D lighting is not supported. The reason is that 2D lighting/shadows uses a completely different rendering system compared to regular lighting. See: http://obi.virtualmethodstudio.com/faq.html Quote:Does it support SRPs (Scriptable Render Pipelines)? kind regards, RE: Obi fluid use 2D light - seenotevil92 - 05-06-2024 (05-06-2024, 07:45 AM)josemendez Wrote: Hi, I have a 2D game that uses sprites and lighting. How can I rewrite the rendering to use this obi asset? RE: Obi fluid use 2D light - josemendez - 05-06-2024 (05-06-2024, 10:58 AM)seenotevil92 Wrote: I have a 2D game that uses sprites and lighting. You'll need to write an entirely custom fluid shader. You can do this using ShaderGraph, then set the ObiFluidRendererPass's MaterialType property to "Custom" and provide a custom material that uses your shader. See "Custom fluid shaders" at the end of the following page: http://obi.virtualmethodstudio.com/manual/7.0/fluidrendering.html You'll need to sample the 2D light texture in your shader, using the "2D Light Texture" node provided by URP. See: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/2d-customlit.html?q=2D%20Light%20Texture%20Node An alternative that doesn't require writing shaders would be to use camera stacking to combine 3D lit meshes - fluid in this case- with 2D lit sprites. RE: Obi fluid use 2D light - seenotevil92 - 05-06-2024 Thank you very much |