EntityColor Color Range

Blitz3D Forums/Blitz3D Programming/EntityColor Color Range

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I don't even know how lighting works in all possible situations.

My main point was that the values you specify in your code get divided by 255.
Then all the internal calculations, whatever they are, get done.
The resulting value gets multiplied by 255 to determine pixel color.

Here's another example to emphasize that there really is no restriction on light values.
Graphics3D 640,480,32,1

AmbientLight 0,0,0

camera=CreateCamera()

cube=CreateCube()  :  PositionEntity cube,0,0,5

blue1# =  300
blue2# = -200

light1 = CreateLight() : LightColor light1, 0, 0, blue1
light2 = CreateLight() : LightColor light2, 0, 0, blue2

While Not KeyDown( 1 )

	If KeyDown( 2 ) Then blue1 = blue1 - 1
	If KeyDown( 3 ) Then blue1 = blue1 + 1
	
	If KeyDown( 4 ) Then blue2 = blue2 - 1
	If KeyDown( 5 ) Then blue2 = blue2 + 1
	
	Delay 40
	
	LightColor light1, 0,0, blue1	
	LightColor light2, 0,0, blue2	
	
	RenderWorld
	
	Text 0,0, "1,2 changes light1.    3,4 changes light2."

	Text 50,50, "light1 blue: " + RSet(blue1, 7)
	Text 50,70, "light2 blue: " + RSet(blue2, 7)
	
	Text 50, 100, "blue1+blue2 = " + (blue1+blue2)
	Text 50, 120, "screen blue = " + ( ReadPixel(320,240) And $FF )
	
	Flip

Wend

End