GetAmbientLight?
Blitz3D Forums/Blitz3D Programming/GetAmbientLight?
| ||
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. |
| ||
Unless you store them, nope. Stevie |
| ||
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? |
| ||
Ah, never thought about that ... good idea!! |
| ||
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. |
| ||
Good thinking Ross! |
| ||
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. |
| ||
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!!! |