Search Unity

Discussion Make emissive material not affected by light

Discussion in 'Shader Graph' started by agus_r, Nov 18, 2022.

  1. agus_r

    agus_r

    Joined:
    Oct 8, 2020
    Posts:
    15
    I am creating shaders that simulate windows where you can see the interiors, this is for a city setting at night and daylight. The interior is "fake" in the sense that there is no additional geometry, it is just a shader trick like in this video.

    I think it should be possible to use a single shader that would work in both lighting conditions, low illumination (night) and orders of magnitude brighter (daylight).

    Physically, the light coming from the windows can be thought as a combination of 2 components:
    A) The light from the room interior, this is basically a hdr cubemap (the hdr slider has to be adjusted so that the emission is actually in the range of indoor lighting).

    B) the glass/shutters reflections of the exterior lights, for the daylight case, this would be way brighter than the interiors.
    The resulting light is a combination of both, A + B in terms of physical photons from these sources.

    But in the shader graph I see that the material is either emissive or not, I don't understand how I could add up the 2 components.
    The emissive interior shouldn't be lit up by the sunshine, and at the same time, the glass, shutters, window frame (all coming from textures) shouldn't be emissive, the only thing that is emissive is the HDR cubemap of the interior. From what I understand of the shadergraph, emissive materials seem to emit more when they are lit up by another light source.
    Any ideas?