Download

Post Process Question

I would like to create a post process shader where certain things would be displayed only on parts of my scene where lights hits my mesh with a certain intensity. It has to be “procedural”, so work with any lights and number of lights in any scene.
The only way I found is by dividing the scenetexture PostProcess0 pass and the scenetexture DiffuseColor, and then setting a threshold with an “IF”, the result of the IF is used as a mask to apply or not my postprocess. This gives me a correct result, but works very badly with high metalness and roughness.

So my question is : Is there a way to have the same result, but fully working ?

Thanks :slight_smile:

so you want only lit surfaces to be displayed in a certain manner and only when lit by certain lights?
can you post a screen of how it is working now?

you can try the light vector node or this:
https://answers.unrealengine.com/questions/86285/help-self-shadowing-materials.html

I think I miss explained haha
I basically want to create a mask to apply my post process. This mask has to be defined by how much light hits my object, and has to work with any number of light (not be specific to one light).
Here are a screenshot of how I did it :

And here is what is the result, as you can see some object are fully white but aren’t very impacted by the lights, that’s because of rougness and metallic, they tend to do “false positives” :

Hope it clarifies !

An image of the same scene as rendered would be helpful since we can’t tell what is ‘rough’ or metallic in the mask.

Obviously ! Here it is

its kinda hacky and i dont know if it will work but you could use a second camera to render to a texture but on that cam use lighting only mode… then turn that lighing texture into a mask
I think there’s a console command for lighting only mode but cant remember now

instead of diffuse use base color…

That would be inneficient but as I plan to use it to render a short film it wouldn’t be that bad !
I’ll try with Base Color thanks

I found this thread, I’ll it !

I think a render target with the lighting only cam with the same settings as my render cam would do the trick

yea thats the console command…

I’m not quite sure on how to use it. What I immagine is executing this command only on one specific camera, but I’m not really savy with blueprint, anyone have any idea ?