Jump to content

How to output pixels that are lit and pixels that are unlit


photo

Recommended Posts

Hi,

 

I have a shader that needs to output pixels that are lit (affected by
deferred lighting) and pixels that are unlit (e.g. a building at night
effect with light-up windows that are not to be affected by lighting,
while the rest of the walls appear darker but lit). Is there a simple
way to indicate per pixel if deferred lighting is to be applied or not
(the diffuse to be maintained as it is)? For example to output a certain
value in one of the buffers alpha? If not, what solution do I have for
this? Have the object rendered in two passes, one with normal lighting
and one with an emissive pass?
Also, I need to apply bloom only in the lit windows area. Is there a way
to apply postprocessing on certain pixels? Or to control the bloom
intensity per pixel?
Plus, is there a way to indicate pixels that are more reflective of the
environment (like windows/mirrors reflecting the env)?

Link to comment

Hi Ben,

 

 

Also, I need to apply bloom only in the lit windows area. Is there a way

to apply postprocessing on certain pixels? Or to control the bloom

intensity per pixel?

Bloom effect is applied already only on the bright pixels, so you don't need to modify anything and add custom post effect. Brighter object will result in larger bloom effect.

 

Plus, is there a way to indicate pixels that are more reflective of the

environment (like windows/mirrors reflecting the env)?

It depends on the material settings. For example, metals are most reflective objects in the scene by default. 

 

 

Regarding your first question - I'm afraid it is not possible. Maybe you can describe in more details what kind of effect you are trying to achieve? You already can use lightmaps for illuminated windows at night or just use emission texture to simulate this kind of effects.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...