05-06-2024, 11:06 AM
(This post was last modified: 05-06-2024, 11:12 AM by josemendez.)
(05-06-2024, 10:58 AM)seenotevil92 Wrote: I have a 2D game that uses sprites and lighting.
How can I rewrite the rendering to use this obi asset?
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/manua...ering.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.un...ure%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.