Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi fluid use 2D light
#1
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.
Reply
#2
(05-06-2024, 12:38 AM)seenotevil92 Wrote: 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.

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)?

Cloth, Rope and Softbodies support all SRPs out of the box, since they do not perform any custom rendering. Obi Fluid does include a custom rendering pipeline based on screen-space ellipsoid splatting, that currently supports the built-in pipeline and URP (no HDRP support yet, no URP 2D lighting system support).



kind regards,
Reply
#3
(05-06-2024, 07:45 AM)josemendez Wrote: 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




kind regards,

I have a 2D game that uses sprites and lighting.

How can I rewrite the rendering to use this obi asset?
Reply
#4
(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.
Reply
#5
Thank you very much
Reply