GPU Collision Bug, no collisions when using Scene Capture Include Only Components

Dear Epic,

#Video of This Engine Bug (4.18.3 & 4.19 preview 6)

Issue: GPU particles do not collide with landscapes, static meshes, or anything, even though in prior engine versinos they worked fine. Happens in 4.17 and 4.18, and 4.19 preview 6

Discovered Reason: Scene capture cameras are affecting Particle System Component’s “sense” of whether they are being viewed, overriding your actual player camera, and if the scene capture camera does not think the PSC is being viewed, the GPU particles do not collide, even if your player camera IS viewing the PSC

Expected: Your actual player camera should matter more than what scene capture cameras are seeing, and if any one of a scene capture camera or your player camera is viewing GPU particles, they should keep colliding

#Repro

Create a scene capture camera actor that uses default settings, via Modes SceneCapture2D or extend the SceneCapture2D blueprint class.

Make sure the scene capture camera is not facing the GPU Particle System Component that you placed in the world

Make sure the scene capture camera actually has a render target texture in the scene that is on an Editor Plane static mesh or some other mesh, if the scene capture does not have a render target texture, this bug does not show up.

If you are having trouble repro-ing, it must be a fully functional scene capture camera. A good way to verify this is to make a Third person template project and make sure you can see the third person character in the scene capture “mirror” plane mesh that you make.

Use the GPU collision particle demo particle system from the Content Samples Epic official downloadable content

If you place the scene capture camera in the scene, the rain drops stop colliding with anything.

If you delete the scene capture camera in the scene, the rain drops instantly start colliding again

#Second Video and Second Repro, in 4.19 preview

I made a second video showing the behavior even more clearly

  1. Make a new third person template project
  2. Add the gpu collision emitter from the Content Examples
  3. Add a scene cap camera with a render texture target
  4. You can now witness the behavior I show in video, if you move the scene cap out of visual range of the PSC with GPU collision

#My theory

Somehow the GPU particles are getting their sense of whether they are being viewed or not from the scene capture camera, and the scene capture camera is not viewing the Particle system component, and so the the GPU particles / the Particle System Component thinks it is not being viewed, so no collision occurs, even though the actual player camera / main render target of the game IS viewing the GPU PSC

#Work Around?

What can I possibly do as a workaround for this?

Is there a custom engine build C++ patch that can fix this easily?

#Pics

#More Info

If you turn Capture Every Frame off in the scene capture camera, collision is restored, it is only when scene cap is actively updating that collision is affected.

Whether you use Show Only Actors or just have the scene capture camera in the scene showing primitives normally, if capturing every frame and if the camera is not viewing the GPU particle system, then it stops having collision

The scene capture camera must have a Render Texture Target or the bug will not occur.

Rama

I reported this over a year ago, but I guess it still there.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

Thanks for reporting this and your clear repro description. I just checked in a fix, although I assume it will have to go into 4.20 as 4.19 is locked down.

It’s a two line change if you want to make it locally. Open up DeferredShadingRenderer.cpp and find the two lines containing ‘&& !Views[0].bIsPlanarReflection’. Add ‘&& !Views[0].bIsSceneCapture’ just after ‘bIsPlanarReflection’.

Eg:

bool bDoFXPrerender = Scene->FXSystem && Views.IsValidIndex(0) && !Views[0].bIsPlanarReflection && !Views[0].bIsSceneCapture;

if (Scene->FXSystem && Views.IsValidIndex(0) && !Views[0].bIsPlanarReflection && !Views[0].bIsSceneCapture)

Then recompile the engine and run.

Note that GPU particles in a scene capture will be one frame behind.

It is very nice to hear from you again !

Thank you for the engine code for the fix!

#:heart:

Rama