Hi,
I’m trying to get Lumen’s lighting information at point in space, through a compute shader, with delayed readback, is there any existing shader function I can use to get that information?
(Sofar my results aren’t really stable, so I mustn’t have found the right shader function/buffer[s]…)
             
            
              
              
              
            
            
           
          
            
            
              Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into sampling Lumen’s indirect lighting information for you.
To help us understand what you are currently doing, and what the issue is, can you please send us a minimal test project that demonstrates your approach, and include screenshots of the issue?
The guide for test projects:
[Content removed]
             
            
              
              
              
            
            
           
          
            
            
              Hello,
Unless I’m mistaken, there’s currently no way to access Lumen’s lighing information on the CPU.
We’d like to sample Lumen’s lighting at a point in world space, so that we can adjust some lighting for special effects.
I presume that I can use “GetTranslucencyGIVolumeLighting” in a shader and write back its result to be read on the CPU, since it should contain relevant information, however I’m unsure and the results are not always stable, specifically when the lighting is relatively low (say a scene lit by a candle/a lamplight).
So I’d like to know whether I’m sampling the right buffer with the right function, and instability is due to Lumen’s algorithm, or whether I’m mistaken and there’s a “better” buffer to sample with a different shader function, to recover lighting at a point.
             
            
              
              
              
            
            
           
          
            
            
              Hi Rodéric & Stephen,
your colleague [Daniel [Content removed] helped me on a very similar issue 2 years ago [in a private [Content removed] (sorry Rodéric you won’t be able to access it), it may be a good starting point to help here
On a high level the easiest way is to achieve this is to :
- “insert” your compute shader c++ pass at the end of UpdateRadianceCaches, all needed data will already be set up for you by the Engine code there
- Add a source location + result information (an array of colors) in FSceneInterface to communicate request & result between game code & UpdateRadianceCaches. Add a critical section there as it will obviously be accessed concurrently
- Add your custom cone trace Compute Shader in LumenRadianceCache.usf, you’ll get all Engine helper functions already available there
We did this on 5.0 and ported the changes without issue to 5.6.1
I hope it will helps
Cø
             
            
              
              
              
            
            
           
          
            
            
              For some reason I didn’t see your message before replying below.
Thank you, I’ll investigate that method further/give it a try.
             
            
              
              
              
            
            
           
          
            
            
              Hello,
Please let us know if the above method works for you.