-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boundary Particles and Fluid Particles spawn in disjointed locations #3
Comments
I checked on Unity 2019 and 2020 and its working for me. If run is not checked the compute shaders are not run so I dont think its a stride issue. The particles are drawn using instancing and require a argument buffer to be created which might be the issue. Since its working on my GPU (GTX 980) it might be a bug in the way Unity creates the buffer or in how the driver works in your GPU but other than that I am not sure what the issue is. |
And just to verify -- the boundary particles shouldn't look like the OP if the project is functioning properly, correct? |
I should add it seems like the Fluid Volume runs fine and the simulation is accurate, despite the Fluid Particles being all over the place. |
Its not meant to look like that. The Boundary particles should be in a neat box around the outside. If the fluid sim still works it must be still getting the correct positions so its probably just the rendering of the particles using DrawMeshInstancedIndirect thats the issue. |
Turns out it's a pretty simple fix! The position in the shader just needs to take in a vector4 instead of a vector3 and then the read of the position in the shader needs to take the x, y, z values instead of just the whole position variable. So basically:
|
I have changed from GTX To RTX, and the same problems occured after the change. this fix works fine for me |
Nice job. Knew I should have stuck to vec4 for everything but did not cause any issues on my gpu went with vec3. |
Hi Scrawk! This repo is really fascinating and I'm having fun digging around in it, but I wanted to check that the behavior I'm seeing is expected.
For this image I haven't done anything to the base code, and I've enabled rendering only for the "Boundary Particles", "Fluid Particles" and "Lines". "Run" is set to off. "Simulation Size" is set to MEDIUM, but it behaves similarly for LOW and HIGH settings.
As you can see, the red Boundary Particles have spawned in disjointed planes. I was expecting these boundaries to form the same lines defined by the "Draw Lines" rendering, forming a continuous box.
Similarly the white Fluid Particles form disjointed planes. Running the simulation causes the Fluid Particles to form a cross-like structure with a plane for each dimension.
This doesn't seem right, and it reminds me a bit of the issues I've had when I've used compute shaders and GPU instancing with improper thread-counts, group sizes, or stride.
Please let me know if I'm running this simulation incorrectly, or if there's anything I can do to help resolve the issue I'm experiencing.
Cheers!
Unity version: 2019.2.21f1
GPU: RTX 2080
Legacy Rendering
The text was updated successfully, but these errors were encountered: