Dynamic VFX light

Hello,

Please, help to choose the best way to add/create/turn-on VFX visible light effect (visible how car shines with it headlight) with dynamic control of brightness and angle at PC scene:

  • [Pre-make lights] Make lights at Blender and export them to GLB, at PC scene find needed light by name and turn-on, control brightness, etc;
  • [Pre-make objects] Make at Blender only objects and export them to GLB, at PC scene find needed object by name and set/unset it as self-illuminated and control it material brightness, etc;
  • [Create lights dynamically on pre-made objects] Make at Blender only objects and export them to GLB, at PC scene find needed object by name and by code create a new light to it and then turn-on, control brightness, etc;
  • [Create objects dynamically on pre-made objects] Make at Blender only objects and export them to GLB, at PC scene find needed object by name and by code create a new self-illuminated object and control it material, brightness, etc;

More simple:

  • Is it possible or not with PCEngine to show visible light beam with GLB light? Or visible light beam can be made only with “self-illuminated object”?
  • Better to pre-make them at LGB or create dynamically?

Code sample?

Like those:

But I would prefer to have a similar effect but via dynamic light source, by CPU calculation or RTX if user it have

you could implement post processing effect to do it in screen space … but it gets pretty expensive (not really suitable for mobile) https://devansh.space/screen-space-god-rays

the prebuilt meshes with custom shader that fades on the edges and also when you get closer is the common high performance approach. This is likely the easiest option to implement.

RTX approach is not viable in webgl as it does not have access to raytracing API.

2 Likes

A) Any possibility for a fast&easy adding Blender VFX to PlayCanvas Engine/Scene?
B) Some developers makes WebRayTracing like those: http://madebyevan.com/webgl-water/ , https://reindernijhoff.net/wolfrt/ , etc. How they make it? Why PlayCanvas not make the same?
C) What about WebGPU support at PlayCanvas?

A) very unlikely
B) yes these approaches are possible, and we have volumetric lighting on our roadmap later in the year, but this is not RTX approach you asked for …
but as mentioned, the postprocessing effect I listed is something that can be added to playcanvas reasonably easily and is similar.
c) we have plans to start working on it in a few months.

1 Like

The conclusion, please:
I) When RTX-RayTracing will be added to PlayCanvas web engine? (WebGPU or similar by YOUR team.)
II) Can RTX-RayTracing be fast added to PlayCanvas web engine manually by external developer for my project only?

Just to be clear here on terms. RTX is not ray tracing. RTX is the Nvidia technology and ray tracing is a technique.

It’s possible to have raytracing without using RTX.

So to be extra clear, do you want to know about access to RTX technology on GPUs or if it’s possible to do ray tracing in PlayCanvas?

1 Like

Thanks for your clarification! Sorry if some of my questions are too simple, I’m a newbie at web 3D area.

Yes, I need a high-quality RayTracing at my web-project for clients inside their web browser.

For the beginning it can be done with CPU or any other method, suppose oneday it will get nVidia RTX support anyway.

So…
I) When RayTracing will be added to PlayCanvas web engine? (WebGPU or similar by YOUR team.)
II) Can RayTracing be fast added to PlayCanvas web engine manually by external developer for my project only?

At the moment we don’t have plans to add raytracing to Playcanvas this year, but we’ll consider it at a later stage. This year we’d like to add WebGPU, which would allow us to use compute shaders, which would be great base for ray tracing.

In the meantime you could implement some version yourself, but it certainly would not be a simple job to get good performance out of it (rener a scatic image within few seconds). Or maybe you can consider integration of some existing ray tracer? For example https://lighttracer.org/ can run in the browser, scroll down a bit for the demo. You could base your realtime rendering on Playcanvas by using GLB models, and then as needed use the same glb models with this raytracer?

1 Like

I’ve already found it, but it real-time looks very badly, image crumbles like a cookie! When I need a high-quality image. Seems their engine still don’t use nVidia RTX thus it just can’t handle real-time high-quality RayTracing. :frowning:

Also their web-editor blocks browser works for about 30sec for “shaders compliting” when CPU was loaded only to 7-8% - which is also non-optimized. :frowning:

There is no way to use the RTX raytracing on the wab at the moment - you’d need a native application for that. So as you can see, it’s not likely you can get high quality and fast raytracing on the web really. But I guess all depends on your use case - if you need to raytrace a diamond ring, that can be done. If whole apartment, that’s a different story.

What about VFX like “neon lights” - self-glow around small lights? It can be done at PC now?

Yes, these are typically done using a small camera facing quads at the light position with some additively blended textures, and this can be done. Play this project - it has few similar light shaft geometries: https://playcanvas.com/project/529572/overview/after-the-flood

2 Likes