How to dim a layer at nightfall?
  • mexster
    junior Member
    Posts: 3
    Joined: Sat Feb 20, 2016 3:49 pm

    How to dim a layer at nightfall?

    by mexster » Mon Nov 28, 2022 11:02 pm

    The title describes my issue. As the sun goes down i need less light output, and when the sun goes up again i need to go back to 100%.
    So what i tried is
    * draw a black rectangle "Nightfademask" over my visual.
    * control its opacity with Weather->Time→Night position.
    * When night starts (as Night Position goes from 0 to 0.1) i dim the mask from 0 to 20%

    This works… partially.
    Problem: after the night is over (Night Position jumps from 1 to 0 again while Day position begins to increase), my Opacity channel doesn't go back, it stays 20% which seems illogical to me.

    Also, this would give me a nice slow fade after sunset, but it theoretically would jump back abruptly at sunrise.

    So… this concept is flawed and it straight up doesn't seem to work for reasons i don't yet understand.

    Please elucidate me: How would I do this properly? Can't we do a more complex mapping where, as night goes from 0…1 my opacity value can go from 0% to 20% and then back to 0%? Any way to use math expressions in control params perhaps?
  • franz
    madMapper master
    Posts: 1033
    Joined: Fri Feb 18, 2005 7:05 pm
    Location: Paris, France
    Contact:

    Re: How to dim a layer at nightfall?

    by franz » Wed Nov 30, 2022 2:17 pm

    I think you're doing it correctly - except you could link your main quad's opacity directly to the Night Position, inverting the target in the control list -. When Night position goes back to 0, the quad should be full on.
    I tested it here - by changing the location actually - , and it is working as expected.
    There seems to be a bug on your side. Mac or Windows, MM version ?

Who is online

Users browsing this forum: No registered users and 14 guests