LightColor + Shininess bug

Archives Forums/Blitz3D Bug Reports/LightColor + Shininess bug

fredborg(Posted 2005) [#1]
Hi,

It seems that changing the light color does not alter the lights shininess/specular properties. Try the following:
Graphics3D 640,480,0,2
SetBuffer BackBuffer()

camera = CreateCamera()
MoveEntity camera,0,0,-3

ball = CreateSphere(32)
EntityShininess ball,1

lite = CreateLight()
MoveEntity lite,10,0,-15
PointEntity lite,ball

Local r#,g#,b#

While Not KeyDown(1)

	If KeyHit(57)
		r# = 255
		g# = 200
		b# = 20
	Else
		r = r*0.95
		g = g*0.95
		b = b*0.95
		If r<1 Then r = 0
		If g<1 Then g = 0
		If b<1 Then b = 0
	EndIf

	LightColor lite,r,g,b

	RenderWorld
	
	Text 0,0,"Press Space"
	Text 0,10,"(R,G,B) = ("+r+","+g+","+b+")"
	
	Flip

	Delay 10

Wend

End
It shows a grey sphere with a white highlight, although the lightcolor is 0,0,0.

Tested on both Radeon and GeForce cards, so it's not a driver issue.


Gabriel(Posted 2005) [#2]
Yep, it's as you say.


DJWoodgate(Posted 2006) [#3]
You can change the specular colors by poking the values into the light structure directly using an external memory function. I suppose it would make sense for the specular colors to be set to the diffuse colors, or better yet, add a function to alow the specular component to be changed independently, since it is independent.

Perhaps it does not even need another function, how about an optional argument on the existing lightcolor one?

LightColor (light, red#,green#,blue# [, component])

Component = 1, change ambient
Component = 2, change diffuse (default)
Component = 3, change specular