Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mesh and Fluid Problem
#21
(13-12-2019, 10:01 AM)josemendez Wrote: Hi,

I found the culprit, seems like a bug in Unity. Turns out the camera depth texture accessible to the shaders isn't cleared to the correct value in OpenGLES unless the camera is explicitly told to render a depth texture. I will raise a bug report.

Found out that I had a regular (deactivated) FluidRenderer attached to the camera. The presence of this renderer set the camera depthTextureMode, so the SimpleFluidRenderer worked well.

Removing the FluidRenderer allowed me to reproduce the issue.

Simply adding this line to the SimpleFluidRenderer's Setup() method fixes it:
Code:
GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;

Attaching the updated SimpleFluidRenderer for convenience.
Excellent) now it works like you) thanks.
Reply
#22
(13-12-2019, 10:08 AM)sc00b Wrote: Excellent) now it works like you) thanks.

you're welcome! Sonrisa
Reply
#23
(13-12-2019, 10:10 AM)josemendez Wrote: you're welcome! Sonrisa

Greetings, I have a question about the scene - FluidMixing. Why can't I see a simulation without a check mark render? And it’s still not clear why I can’t connect 2 Simple Fluid?
Reply
#24
(16-12-2019, 10:07 PM)sc00b Wrote: Greetings, I have a question about the scene - FluidMixing. Why can't I see a simulation without a check mark render? And it’s still not clear why I can’t connect 2 Simple Fluid?

The FluidMixing sample scene does not include a FluidRenderer in the camera, only a ParticleRenderer. We wanted to make individual particles visible here.

I don't understand the question of 2 SimpleFluid... what do you mean by "connecting"?
Reply
#25
(17-12-2019, 08:02 AM)josemendez Wrote: The FluidMixing sample scene does not include a FluidRenderer in the camera, only a ParticleRenderer. We wanted to make individual particles visible here.

I don't understand the question of 2 SimpleFluid... what do you mean by "connecting"?
And how do we make the fluid render on our stage so that it is beautiful when mixed?

(17-12-2019, 08:02 AM)josemendez Wrote: The FluidMixing sample scene does not include a FluidRenderer in the camera, only a ParticleRenderer. We wanted to make individual particles visible here.

I don't understand the question of 2 SimpleFluid... what do you mean by "connecting"?

camera https://i.imgur.com/MloRbfi.png and emitter https://i.imgur.com/p1jEqSg.png - here it doesn’t work here, although everything was done as on that stage, without rendering only
Reply
#26
(17-12-2019, 08:37 AM)sc00b Wrote: And how do we make the fluid render on our stage so that it is beautiful when mixed?


camera https://i.imgur.com/MloRbfi.png and emitter https://i.imgur.com/p1jEqSg.png - here it doesn’t work here, although everything was done as on that stage, without rendering only

Just place a FluidRenderer component in your camera, that references your particle renderer. Also make sure the renderer's radius scale is high enough so that particles overlap a bit and form a isosurface. Setting it to 1.5-2 is usually enough.

Why do you have 3 fluid renderers, instead of having just one that references the 3 particle renderers? That's extremely costly. There's a reason why the fluid renderer accepts an array of particle renderers as input, to render them all at once. See the FluidBuoyancy sample scene for an example on how to setup multiple renderers.
Reply
#27
(17-12-2019, 08:48 AM)josemendez Wrote: Just place a FluidRenderer component in your camera, that references your particle renderer. Also make sure the renderer's radius scale is high enough so that particles overlap a bit and form a isosurface. Setting it to 1.5-2 is usually enough.

Why do you have 3 fluid renderers, instead of having just one that references the 3 particle renderers? That's extremely costly. There's a reason why the fluid renderer accepts an array of particle renderers as input, to render them all at once. See the FluidBuoyancy sample scene.

This is done so that the player can choose one or another color)
Reply
#28
(17-12-2019, 08:51 AM)sc00b Wrote: This is done so that the player can choose one or another color)

Particle colors are set in the ParticleRenderer and/or the emitter shape, not the FluidRenderer. You can still have one FluidRenderer and have particles of multiple colors.

Using a separate FluidRenderer for each fluid not only is extremely costly (3-5 full screen buffers are used for each fluid renderer), it also serves no purpose at all.
Reply
#29
(17-12-2019, 08:53 AM)josemendez Wrote: Particle colors are set in the ParticleRenderer and/or the emitter shape, not the FluidRenderer. You can still have one FluidRenderer and have particles of multiple colors.

Using a separate FluidRenderer for each fluid not only is extremely costly (3-5 full screen buffers are used for each fluid renderer), it also serves no purpose at all.

That's what we get, but it's not that (
https://i.imgur.com/1OQWtoE.png
https://i.imgur.com/m5L0iiU.png
https://i.imgur.com/neORjs1.png
Reply
#30
(17-12-2019, 01:07 PM)sc00b Wrote: That's what we get, but it's not that (
https://i.imgur.com/1OQWtoE.png
https://i.imgur.com/m5L0iiU.png
https://i.imgur.com/neORjs1.png

The particle renderer's radius scale is way too small for particles to generate a surface. Try setting it to 1.7-2, and disable the "render" checkbox too.
Reply