Light source and color?

Mar 26, 2013 at 4:26 PM
I read in the documentation that I can set the angle the light source come from and its strenght (the shadow opacity).

I think that a good feature could be the ability to set the light color. In this way I can simulate the daylight, connected with the server time.

I would like to display a map, with isometric buildings, elements and troops, with the light directly influenced by the time you are looking at them.
At the morning the shadows will be from right to left, long and soft, yellow colored.
At noon, shadows will be short, directly from the head, white colored.
At evening, opposite direction, blue tinted.
At night, everything turns blue and black.

The color is the only thing missing, because I can arrange angle and opacity of the light related to time.
Mar 26, 2013 at 5:00 PM
The trick to achive light color changes in the example was to hover an overlay div over the canvas with a custom background-color:
<div style="position:relative;">
  <canvas id="maincanvas" width="900" height="500"></canvas>
  <div style="background-color:#D1A200;width:900px;height:500px;position:absolute;top:0px;opacity:0.1;"></div>
</div>
So for morning scenes you would use a slightly yellow colored overlay div, for night scenes the div should have a blue background-color, etc.
Is this solution not adequate for you or are you looking for a different effect?
Mar 26, 2013 at 5:07 PM
No, it's simply perfect! I like easy solutions! This would be great.
Maybe I can do it also inside the canvas, placing a big sheet in front of the camera, filled with the color of choice and with the right opacity ...

Thank you!
Mar 26, 2013 at 7:07 PM
You could do that too, however I would not recommend it. The smaller amount of sheets you use, the more performant solution you'll get.