Skip to content
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

cannot run corrctly... #1

Open
supernigel opened this issue Apr 11, 2019 · 6 comments
Open

cannot run corrctly... #1

supernigel opened this issue Apr 11, 2019 · 6 comments

Comments

@supernigel
Copy link

when i import the project to unity...the material of obj is error and lose the script.

@AndrewRH
Copy link

Yes..I think this is because they didn't commit the .meta files :(

@AndrewRH
Copy link

The cloth scene is easy to fix though:

  1. Assign the cloth material to the cloth
  2. Assign "ClothFrictionCollider" script to the floor missing script and set Fiction to 0.1
  3. Assign "GPUClothSimulator" script to the missing script on GPUCloth object, and set the Collidable Objects to the Sphere and the Floor, and set PBD Cloth Solver to the compute shader PBDClothSolver, and set gravity to 0, -9.8, 0

That should get it running

@Phantomhive123
Copy link

I am really interested in the PBFluid scene. But it can't run correctly either and I don't know how to fix it. What a pity :(

@asbjornlystrup
Copy link

asbjornlystrup commented Jun 19, 2021

I got the fluid scene working by doing this (in Unity version 2018.4.36f1):

  1. Upgrade Unity project to 2018.4.36f1 with the popup that appears at first load.
  2. For the "Main Camera" scene object, assign scripts FreeCam and SkyboxRotation where the two missing scripts are. Also assign SkyboxMat to the missing material slot in the Skybox here.
  3. For the SkyboxMat asset itself, assign the six textures in SkyboxTexture so the texture filenames match the missing texture slots there.
  4. For the "PBFContainer" scene object, assign script PBFluidScript, and fill that script's missing "Fluid Particle Mat" slot with the "Particle" material asset. Then drag the mesh inside the "ParticleSphere2" asset (or "ParticleSphere1" asset) onto the "Render Sphere Mesh" slot of the script. Then drag the Container scene object onto the "Container transform" slot, and the FluidChunk scene object onto the "Fluid Chunk Transform" slot. Also drag the FluidChunk scene object onto the "Fluid Chunk Renderer" slot.
  5. In the "Particle" material asset, change the shader from "Hidden/InternalErrorShader" in the dropdown to "PBDFluid/Particle".
  6. Set the Container scene object's material to the GlassWaterTank material by e.g. dragging the GlassWaterTank material onto the Container scene object in the scene view.

That should be it!

Edit: I tried getting the cloth to work in the same Unity version, following AndrewRH's instructions. For it to work I also had to change frictionsBuffer = new ComputeBuffer(numParticles, sizeof(float) * 3); to frictionsBuffer = new ComputeBuffer(numParticles, sizeof(float)); in GPUClothSimulator.cs. Probably just a typo by the authors that didn't throw an error until later versions of Unity.

@shaolinseed
Copy link

I got the fluid scene working by doing this (in Unity version 2018.4.36f1):

  1. Upgrade Unity project to 2018.4.36f1 with the popup that appears at first load.
  2. For the "Main Camera" scene object, assign scripts FreeCam and SkyboxRotation where the two missing scripts are. Also assign SkyboxMat to the missing material slot in the Skybox here.
  3. For the SkyboxMat asset itself, assign the six textures in SkyboxTexture so the texture filenames match the missing texture slots there.
  4. For the "PBFContainer" scene object, assign script PBFluidScript, and fill that script's missing "Fluid Particle Mat" slot with the "Particle" material asset. Then drag the mesh inside the "ParticleSphere2" asset (or "ParticleSphere1" asset) onto the "Render Sphere Mesh" slot of the script. Then drag the Container scene object onto the "Container transform" slot, and the FluidChunk scene object onto the "Fluid Chunk Transform" slot. Also drag the FluidChunk scene object onto the "Fluid Chunk Renderer" slot.
  5. In the "Particle" material asset, change the shader from "Hidden/InternalErrorShader" in the dropdown to "PBDFluid/Particle".
  6. Set the Container scene object's material to the GlassWaterTank material by e.g. dragging the GlassWaterTank material onto the Container scene object in the scene view.

That should be it!

Edit: I tried getting the cloth to work in the same Unity version, following AndrewRH's instructions. For it to work I also had to change frictionsBuffer = new ComputeBuffer(numParticles, sizeof(float) * 3); to frictionsBuffer = new ComputeBuffer(numParticles, sizeof(float)); in GPUClothSimulator.cs. Probably just a typo by the authors that didn't throw an error until later versions of Unity.

I get a load of particles outside my container when trying this, any idea why? Thanks so much for this as well helped me get to this point!

@asbjornlystrup
Copy link

asbjornlystrup commented Sep 5, 2021

I got escaping particles as well. Especially when disabling viscosity. Not sure why. I would guess the collision handling of the container's walls has a bug in it, or just a strong limitation. Perhaps you can fix it by simply clamping the particle positions to the container's bounding box somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants