NVIDIAGameWorks / FleX

Other
646 stars 99 forks source link

Unity plugin fluid error out of bounds #115

Open grubm opened 3 years ago

grubm commented 3 years ago

Too bad that nvidia has abandoned this project, but just in case anyone else runs into the out of bounds issue with fluids, here is a fix (_auxFlexDrawFluid.cs around line 245)

                if (m_indexBuffer != null)
                {
                    // (mg) if m_scence.container.fluidIndices reserves a larger capacity than the actual number of particles
                    // only copy the valid particles so we don't overflow
                    m_indexBuffer.SetData(indices, 0, 0, indexCount);
                }

Repro steps for this bug: open the scene in Flex Samples/9 and change the source actor's start speed to a lower value like 2.0