21-05-2024, 09:25 AM
(This post was last modified: 21-05-2024, 09:27 AM by josemendez.)
(16-05-2024, 05:17 PM)spikebor Wrote: Still cannot get over the resetting looks of the surface texture:
Low advect time scale result in bad resetting looks, high value result in extreme stretching.
The effect of resetting makes it look like a pulsing organic surface, really distracting.
The advection model is optimized for foam-like stuff, where the pulsing at rest is used to hide texture repetition. Open up ObiFlowMapping.cging and comment out lines 17 and 18:
Code:
flowUV1 += (time - phase1) * jump;
flowUV2 += (time - phase2) * jump + 0.5;
That should improve the resetting look.
(16-05-2024, 05:17 PM)spikebor Wrote: Wind does not work correctly with fluid particle mass:
You can drag the wind intensity slider on screen and see, at wind str 10, the lava particles are flown away like it is as light as the character hair (mass 0.5), but actually the mass of Lava is at a massive value 250kg per particle.
Wind in fluids is scaled by the fluid's atmospheric drag.
(16-05-2024, 05:17 PM)spikebor Wrote: Can you set the transparent fluid render on top of opaque fluid?
Currently the transparent fluid will render the dark gray scene floor behind it. It should render the lava behind it, or any opaque fluid.
Your IndirectOpaque shader is set to "transparent" in URP. Set it to opaque for it to render correctly behind transparent objects.
(16-05-2024, 05:17 PM)spikebor Wrote: The performance hiccup
At some part of the play duration, there is 1% fps at 1fps, which is a very bad frame drop. The scene only has 3 fluid emitters, 1 cape, and character ObiBone (hair), it should not be that bad.
I'm unable to reproduce any performance drops. Could you share a capture of your profiler in timeline mode, during one of these hiccups?
(16-05-2024, 05:17 PM)spikebor Wrote: Pointer to the way to make a type of fluid to cool down the Lava?
I know what I should look into is the Raclette sample, but still, it does not have many comments in code to see what is going on.
Like make use of userdata, a value to give it a cool or hot, and the shader can use that value to lerp the emission.
For your specific use case you could look into driving the particle's color using userData. You just copy the contents of the userData array to the color array, making any conversion you deem necessary. Particle color gets passed on to the mesh vertices, so you could then write a custom shader that uses the color of the particles to drive texture emission and cool down the lava.
Note it is not possible to access arbitrary per-particle data from a shader. The reason is only vertex data is accessible to a shader, and for things like userData (or other particle properties like mass or density) to be directly accessible from a shader they would need to be averaged during fluid mesh construction and packed into the vertex format.
Currently, fluid vertices store fluid velocity, normal and color. It's not within our plans to add more data to the vertex format, as storing more data would increase the size of vertices and hence the memory usage of chunks, making it harder to have larger amounts of fluid. For this reason we've strived to keep the vertex size as small as possible: color is compressed and normals use octahedral encoding.
(16-05-2024, 05:17 PM)spikebor Wrote: Wishlist for the feature to directly reference a custom fluid material in the ObiFLuidSurfaceMesher or Emitter for every emitter.
For now, I overwrite the IndirectOpaque shader to give the fluid that Lava emission feature, which should be a local material, not globally used by all the fluid right?
This is already possible, you can change the mesher's material type from Opaque or Transparent to "Custom", and provide an entirely custom material. Note that the shader you use still needs to access vertices in a specific way since Obi uses a compressed vertex format for fluids. See the manual for an example of a minimal shader (scroll to the bottom of the page):
http://obi.virtualmethodstudio.com/manua...ering.html