How to Cyberpunk 2077 smoke rendering?

Hey everyone! First time posting here, few months back I switched to and started learning realtime fx(I have more than a year experience with non realtime/cinematic fx) have been lurking around here for some weeks… and this forum has been super helpful!!

I have been trying to recreate Cyberpunk 2077’s vfx as a study for myself and came across this…
cyberpunkSmoke
In Game Screen Recording

How did they achieve this? I tried to find out alot by myself, always knew about 6d Lightmap and came to learn about ray marching… but after looking at it, I don’t think this has anything to do with it I guess? But the way the smoke is being lit up, only where light rays are visible due to volumetric fog… Kind of camera view dependent. I thought unreal engine does this by default but it doesn’t.

I tried it myself but it lights up weirdly. (lighting only mode is on so exponential height fog isnt visible) Whether its a dark environment with lower intensity light, it doesn’t matters at all, still renders it the same way.
mysmoke
UE5.2 Viewport

I believe this I’ll have to do some work with shader, I could be wrong any information on this would be helpful. Or is this raymarching? If so I have two questions…

  1. I did try to find resources from which I can study it, but there is less info on it, even the uncharted 4 siggraph presentation, I cannot find it at all :frowning: so could anyone share any links to that? Anything related to smoke raymarching would help be progress.
  2. Is it even being used in games? I hear its expensive so is it worth learning it? Because ultimately I would like to showcase my studies and apply for a job (but would love to still learn about it for myself), also I rarely saw any discussion related to raymarching in this forum.

Proper Translucency receive/cast shadow is quite expensive. In your case, the only way to avoid that flickering issue is to use the “Surface ForwardShading” lighting model under the “Translucency” section in the material, which is the most expensive translucency lighting available out of the box.

If you want to enable cast shadow, you will also need to enable “Cast Dynamic Shadow As Masked” under the “Material/Advanced” section in the material, but the shadow is practically masked opaque without an option to make it dither-y.

If you want translucency receive shadow from other translucency, you can enable “Support Volumetric Translucent Self Shadowing” in project setting, but the masked opaque nature of the translucent shadow makes the result not looking elegant to my eye.

2 Likes

Thanks a ton for the reply. Yes this does makes sense, I’ll try it out and let you know. But even if it’s expensive, are you suggesting that Cyberpunk 2077 does this too? (as shown in the GIF) I’ve seen these type of smoke rendering almost everywhere in the game… What do you think?

Cyberpunk 2077 uses in-house REDengine. I know it sounds offensive, but the game is not known for good optimization. Either way, as long as your don’t jack up the intensity of your spotlights too high, you can get away by using the Volumetric (PerVertex) lighting modes of the translucent materials, either directional or non-directional.

The flickering occurs when you move the spotlight around. The flickering seems to be due to the limitation of cone culling of the spotlight, which wouldn’t be the case with directional light or point light.

Still, I am not a lighting artist or engine programmer, so take my words with a grain of salt.

Hey, I tried it out and it did work! thanks a ton, I did not know deferred rendering is a separate thing, thanks to you I was able to understand that translucency in unreal engine does not use forward rendering by default.

And yes I am aware that they use REDengine and how bad its optimization is, if I’m not wrong it is one of the main reasons why CD Projekt Red is switching to Unreal Engine for their future games.
Even if the Surface ForwardShading is expensive I simply wanted to know or have knowledge on how to achieve such a look if I need in the future for my smoke to render like that, thanks to you now I know that and also know how expensive it is. :smile:

Anyway sorry to bother you again but could you share any comment on the last two questions I asked, anything on smoke raymarching would be helpful… If not no issues thanks a ton for your help anyway.