GetAmbientLight?

Blitz3D Forums/Blitz3D Programming/GetAmbientLight?

_PJ_(Posted 2006) [#1]
Is there any way of getting the value of Ambient light once set?

I've generated mine from a formula and the variables may since have changed. It's no big deal, because I can just use different vars instead, but I was just curious.


Stevie G(Posted 2006) [#2]
Unless you store them, nope.

Stevie


Ross C(Posted 2006) [#3]
What about this. Hiding all the lights. Create a sprite, and position it in the centre of the cameras view. Make sure it's coloured white. Then read the pixel value at the centre of the screen. This should give you the value of the ambient light surely?


Stevie G(Posted 2006) [#4]
Ah, never thought about that ... good idea!!


Ross C(Posted 2006) [#5]
I had the same thought for cubemaps, to see if they are properly supported and dot3 maps too. You'd need to run it on a computer that supported it, to get the values of the readpixel though. But once you've done that, you can compare it on the machines it's running on.


_PJ_(Posted 2006) [#6]
Good thinking Ross!


Chevron(Posted 2006) [#7]
That is a clever solution Ross, but surely if you are setting the ambient light value at a particular point you could just set a variable , say my_ambeint_light# to the same value. This would surely reduce the overhead and complexity.


_PJ_(Posted 2006) [#8]
Which is what I had to go back and do before Ross posted. But in the event that I would have been unable to fix it in that manner, then Ross' solution would have helped!

So Ross provided a way of doing a 'Get Ambient Light' function, as requested although the method of using variables is of course more efficient!!!