3D particle system

This is the first release of a simple, GPU-based 3D particle system for Castle Game Engine. You can find it in this github repository.

It also includes a simple particle editor as part of its demos:

Some thoughts:

  • I originally planned on doing soft particle and screen-space physics by sampling the depth buffer. However it will mess up the current ScreenEffect system if I setup RenderToTexture manually. So I will wait for ScreenEffect rework first and see if I could work around the new system :slight_smile:
  • Currently its only useful for effects like dust, fire, smoke, fountain etc. Other effects that require trails like sparkle, or rotating in space like falling leaves are not supported yet.
1 Like

Because emitter is descendant of TCastleSceneCore and uses direct OpenGL calls instead of CGE’s own renderer, there’re a lot of TCastleScene’s functionality and behaviors that are missing at the moment. I’ve spent the last few days to add some of it back:

  • BoundingBox and frustum culling works. The emitter doesn’t calculate bounding box so you need to set up bounding box manually via Effect.BBox property, either by code or by using particle editor / edit particle file.
  • Visible works.
  • The component registers to TRenderStatistics as 1 Shape / 1 Scene.
  • Instancing, by putting the same emitter to multiple TCastleTransform nodes works. It doesn’t use GPU instancing at the moment.

Edit: I decide to remove ProcessEvents at the moment, mainly for backward compatibility with the old 2D particle system.

1 Like

Amazing work thank you, this is important feature for engine

Yeah this looks absolutely cool. I have it in TODO to review and

1 Like

I just add 2 new parameters: Radial and it’s variance. This allows to create swirl effects like dust devil or similar :slight_smile: An example for this effect also added to demos.

1 Like