Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Fading in the ambient light  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

FogGobbler

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 228
    • View Profile
Fading in the ambient light
« on: July 11, 2007, 05:50:14 PM »

Hi!

Is there a way of fading in the AmbientLightColor? When my character enters a certain region the ambient color should change. I´ve got so far, but the effect is not very nice, because its more like turning on a light. I´ve tried doing it with a "for-loop", but without success.

Code: [Select]
on "ActorEntry"
{
   Scene.AmbientLightColor = MakeRGBA(253,153,0,255);
}

on "ActorLeave"
{
   Scene.AmbientLightColor = MakeRGBA(0,0,0,255);
}

Thanks,
Oli
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Fading in the ambient light
« Reply #1 on: July 12, 2007, 07:33:02 AM »

For ambient light there applies exactly the same what I said here about normal lights. That is, for shade-of-gray lights you can set the R, G and B components to the same value in a loop. For colored lights, you'd need to extract the luminance.
Also note that the alpha component has no effect on any lights.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.194 seconds with 24 queries.