Posts: 39
Threads: 2
Joined: Dec 2019
Reputation:
0
(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.
Posts: 6,320
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(13-12-2019, 10:08 AM)sc00b Wrote: Excellent) now it works like you) thanks.
you're welcome!
Posts: 39
Threads: 2
Joined: Dec 2019
Reputation:
0
16-12-2019, 10:07 PM
(This post was last modified: 16-12-2019, 10:08 PM by sc00b.)
(13-12-2019, 10:10 AM)josemendez Wrote: you're welcome!
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?
Posts: 6,320
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
17-12-2019, 08:02 AM
(This post was last modified: 17-12-2019, 08:02 AM by josemendez.)
(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"?
Posts: 39
Threads: 2
Joined: Dec 2019
Reputation:
0
17-12-2019, 08:37 AM
(This post was last modified: 17-12-2019, 08:41 AM by sc00b.)
(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
Posts: 6,320
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
17-12-2019, 08:48 AM
(This post was last modified: 17-12-2019, 08:51 AM by josemendez.)
(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.
Posts: 39
Threads: 2
Joined: Dec 2019
Reputation:
0
(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)
Posts: 6,320
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
17-12-2019, 08:53 AM
(This post was last modified: 17-12-2019, 08:54 AM by josemendez.)
(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.
Posts: 39
Threads: 2
Joined: Dec 2019
Reputation:
0
(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
Posts: 6,320
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
17-12-2019, 02:07 PM
(This post was last modified: 17-12-2019, 02:07 PM by josemendez.)
(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.
|