Old school Doom diminished lighting

I’m looking at implementing diminished lighting that Doom used.

So far I’m using PixelDepth, tweaking it with a distance variable and the multiplying it against the texture. It kinda works but has two draw backs.

  • Content has to be tweaked against the distance variable
  • It’s got a hard edge on the boundary (see video in unlit mode)

Anyone have any ideas to implement this is a little nicer, smoother and more subtle?

I’m working on this for a VR game so I’d like to avoid Post Processing.

I think you could achieve this easily with a post process blendable? There might be some examples in the chameleon kit which was free a few months back. I know you can definitely do a circle radius around the camera position. might achieve what you want… Other option would be some kinda fog?

Thanks for the reply @gozu. What did you mean by “circle radius around the camera position”. Is that a node in the material editor?

I played with Fog Gradients from the Marketplace and it has a few rendering issues in VR. It kinda creates this effect. I have the Chameleon pack and will try it’s Fog solution soon.

SphereMask.
Using camera location and a preset radius.

I would simplify all the materials and make this in a post process instead. It should be way more performant.

pixel depth is making each calculation on a per pixel basis.
the post process would just add over the top. Render to a texture and mix the 2 together - theoretically it should be more performant.

As far as the node, a sphere mask with a hardness of .1 has a good falloff, and you can multiply scene color by the light color to get the final scene color/darkness you need.

Lerp scene color into 0, to multiplied scene color into 1, using the sphere mask as the alpha.

Thank you [USER=“3140864”]MostHost LA[/USER] that works a lot better. I didn’t profile it yet but it maintained a solid 90FPS in VR. It makes tweaking lighting a little different but it’s a much better solution. Simplifying my core base material is a nice little bonus.

I added a clamp so it never goes completely black. Still needs some tweaking but it’s a good start.