5

I would like to create "god rays" effect/lighting on a 3D shape. If I have a Box, I would like to have a light source behind it that will create "god rays" around it. Below, is an image I found showing the idea (imagine the window as an opaque box and the rays coming around all sides):

enter image description here

I tried setting a PointLight source, but all lights illuminate "solid" objects, so you can't see the effect around them. My guess would be to fill the area around the shape with some sort of air-like, partially transparent material, that engulfs the shape; and that the light can reflect from.

How would I go about creating "god rays?

Nadim Baraky
  • 459
  • 5
  • 18
Mark
  • 2,167
  • 4
  • 32
  • 64
  • 2
    The automatic mandatory downvote is here again... – Mark Oct 30 '16 at 22:12
  • You should show what you tried first – Rogue Oct 30 '16 at 22:12
  • 2
    @Rogue I wrote explicitly what I tried. It's extremely simple. Add a box and a PointLight behind it. You won't see the box anyway because the light is hidden. Nothing non-trivial to show. – Mark Oct 30 '16 at 22:13
  • JavaFX 8 3D does not natively support [volumetric lighting](https://en.wikipedia.org/wiki/Volumetric_lighting). Creating your desired effect without native support in the underlying toolkit will likely prove extremely difficult for you or anybody else. – jewelsea Oct 31 '16 at 18:43
  • Nvidia created a presentation on the [maths and algorithms behind this effect](https://developer.nvidia.com/sites/default/files/akamai/gameworks/downloads/papers/NVVL/Fast_Flexible_Physically-Based_Volumetric_Light_Scattering.pdf) and apparently have an open-source library in their Gameworks SDK to demonstrate an implementation (I don't have a link to that). Note, the Nvidia implementation is not JavaFX based and accessing similar functionality from JavaFX would be difficult. – jewelsea Oct 31 '16 at 19:00
  • @jewelsea Thanks! it looks like a dead end for now. i will try to play a bit with the current option to get some semblance of this effect. i have a couple of ideas for specific use cases i want to try when i get the time. – Mark Oct 31 '16 at 21:44

0 Answers0