I am trying to get some Flex fluid into a VR app that uses the SteamVR plugin.
I downloaded Flex v1.0.5 (latest as of Feb 2019), opened example no.9 Fluid Renderer, pressed Play and I can see the fluid work fine in VR. Good.
I now delete the camera and replace it with the [CameraRig] of the SteamVR plugin. Now when I press Play I see the fluid for a few seconds and then it stops and 2 errors gets logged:
ArgumentException: ComputeBuffer.SetData() : Accessing 35100 bytes at offset 0 for Compute Buffer of size 35000 bytes is not possible.
UnityEngine.ComputeBuffer.SetData (System.Array data) (at C:/buildslave/unity/build/Runtime/Export/ComputeShader.bindings.cs:124)
NVIDIA.Flex._auxFlexDrawFluid.UpdateMesh (NVIDIA.Flex.FlexContainer+ParticleData _particleData) (at Assets/3rd Party/NVIDIA/Flex/Auxiliary/_auxFlexDrawFluid.cs:247)
NVIDIA.Flex.FlexContainer.UpdateDrawFluid (NVIDIA.Flex.FlexContainer+ParticleData _particleData) (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:788)
NVIDIA.Flex.FlexContainer.UpdateSolver () (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:696)
NVIDIA.Flex.FlexContainer.FixedUpdate () (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:605)
NVIDIA.Flex.FlexScene.FixedUpdate () (at Assets/3rd Party/NVIDIA/Flex/Helpers/FlexScene.cs:68)
LogWarning - Mapping a buffer that was already mapped
File - ..\..\dx\utils.cpp (62)
UnityEngine.Debug:LogError(Object)
NVIDIA.Flex.FlexContainer:ErrorCallback(ErrorSeverity, IntPtr, IntPtr, Int32) (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:491)
NVIDIA.Flex.FlexExt:MapParticleData()
NVIDIA.Flex.FlexContainer:UpdateSolver() (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:688)
NVIDIA.Flex.FlexContainer:FixedUpdate() (at Assets/3rd Party/NVIDIA/Flex/Assets/FlexContainer.cs:605)
NVIDIA.Flex.FlexScene:FixedUpdate() (at Assets/3rd Party/NVIDIA/Flex/Helpers/FlexScene.cs:68)
By disabling the various components in the camera rig it seems that the issue is with SteamVR_Behaviour_Pose
. Any idea what it could be and how to resolve?
Thank you.