@ -392,30 +392,30 @@ const struct {
{ { 40 , 40 } , 0x222222 _rgb + 0xff8080 _rgb * dot ( Vector3 { 1.0f , - 1.5f , 0.5f } . normalized ( ) , Vector3 : : zAxis ( ) ) * 2.0f }
{ { 40 , 40 } , 0x222222 _rgb + 0xff8080 _rgb * dot ( Vector3 { 1.0f , - 1.5f , 0.5f } . normalized ( ) , Vector3 : : zAxis ( ) ) * 2.0f }
} } } ,
} } } ,
{ " point " , " light-point.tga " ,
{ " point " , " light-point.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
1.0f , Constants : : inf ( ) ,
1.0f , Constants : : inf ( ) ,
{ Containers : : InPlaceInit , {
{ Containers : : InPlaceInit , {
/* The range is inf, so it doesn't get fully ambient even at the
/* The range is inf, so it doesn't get fully ambient even at the
edge */
edge */
{ { 8 , 71 } , 0x242324 _rgb } ,
{ { 8 , 71 } , 0x2c2727 _rgb } ,
/* Closest to the light. TODO figure out the equation, sigh */
/* Closest to the light */
{ { 63 , 16 } , 0xc57474 _rgb /*0x222222_rgb + 0xff8080_rgb/(1 + 0.25f*0.25f)*/ } ,
{ { 63 , 16 } , 0x222222 _rgb + 0xff8080 _rgb / ( 1 + 0.75f * 0.75f ) } ,
/* Specular highlight */
/* Specular highlight */
{ { 60 , 19 } , 0xfefefe _rgb }
{ { 60 , 19 } , 0xc47575 _rgb }
} } } ,
} } } ,
{ " point, specular material color " , " light-point-specular-color.tga " ,
{ " point, specular material color " , " light-point-specular-color.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , 0x80ff80 _rgbf , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , 0x80ff80 _rgbf , Color3 { 1.0f } ,
1.0f , Constants : : inf ( ) ,
1.0f , Constants : : inf ( ) ,
{ Containers : : InPlaceInit , {
{ Containers : : InPlaceInit , {
/* Colored specular highlight */
/* Colored specular highlight */
{ { 60 , 19 } , 0xf2fcb0 _rgb }
{ { 60 , 19 } , 0xc27573 _rgb }
} } } ,
} } } ,
{ " point, specular light color " , " light-point-specular-color.tga " ,
{ " point, specular light color " , " light-point-specular-color.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , 0x80ff80 _rgbf ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , 0x80ff80 _rgbf ,
1.0f , Constants : : inf ( ) ,
1.0f , Constants : : inf ( ) ,
{ Containers : : InPlaceInit , {
{ Containers : : InPlaceInit , {
/* Colored specular highlight */
/* Colored specular highlight */
{ { 60 , 19 } , 0xf2fcb0 _rgb }
{ { 60 , 19 } , 0xc27573 _rgb }
} } } ,
} } } ,
{ " point, attenuated specular " , " light-point-attenuated-specular.tga " ,
{ " point, attenuated specular " , " light-point-attenuated-specular.tga " ,
{ 1.0f , - 1.0f , - 0.25f , 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 1.0f , - 1.0f , - 0.25f , 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
@ -423,10 +423,10 @@ const struct {
{ Containers : : InPlaceInit , {
{ Containers : : InPlaceInit , {
/* Specular highlight shouldn't be brighter than the attenuated
/* Specular highlight shouldn't be brighter than the attenuated
intensity */
intensity */
{ { 57 , 22 } , 0x665656 _rgb }
{ { 57 , 22 } , 0xa68787 _rgb }
} } } ,
} } } ,
{ " point, range=1.5, specular color " , " light-point-range1.5.tga " ,
{ " point, range=1.5, specular color " , " light-point-range1.5.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , 0x80ff80 _rgbf ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , 0x80ff80 _rgbf ,
1.0f , 1.5f ,
1.0f , 1.5f ,
{ Containers : : InPlaceInit , {
{ Containers : : InPlaceInit , {
/* Color goes back to ambient at distance = 1.5 */
/* Color goes back to ambient at distance = 1.5 */
@ -434,25 +434,25 @@ const struct {
{ { 29 , 50 } , 0x222222 _rgb } ,
{ { 29 , 50 } , 0x222222 _rgb } ,
{ { 19 , 14 } , 0x222222 _rgb } ,
{ { 19 , 14 } , 0x222222 _rgb } ,
/* But the center and specular stays ~ the same */
/* But the center and specular stays ~ the same */
{ { 63 , 16 } , 0xc57474 _rgb } ,
{ { 63 , 16 } , 0xb16a6a _rgb } ,
{ { 60 , 19 } , 0xf2fcb0 _rgb }
{ { 60 , 19 } , 0xad6a69 _rgb }
} } } ,
} } } ,
{ " point, intensity=10, range=0.5 " , " light-point-intensity10-range0.5 .tga " ,
{ " point, intensity=10, range=1.0 " , " light-point-intensity10-range1.0 .tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
10.0f , 0.5 f, { } } ,
10.0f , 1.0 f, { } } ,
/* Range ends right at the surface, so no contribution */
/* Range ends right at the surface, so no contribution */
{ " point, range=0.2 5 " , " light-none.tga " ,
{ " point, range=0.7 5 " , " light-none.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
1.0f , 0.2 5f , { } } ,
1.0f , 0.7 5f , { } } ,
/* Zero range should not cause any NaNs, so the ambient contribution is
/* Zero range should not cause any NaNs, so the ambient contribution is
still there */
still there */
{ " point, range=0.0 " , " light-none.tga " ,
{ " point, range=0.0 " , " light-none.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
1.0f , 0.0f , { } } ,
1.0f , 0.0f , { } } ,
/* Distance is 0, which means the direction is always prependicular and
/* Distance is 0, which means the direction is always prependicular and
thus contributes nothing */
thus contributes nothing */
{ " point, distance=0 " , " light-none.tga " ,
{ " point, distance=0 " , " light-none.tga " ,
{ 0.75f , - 0.75f , - 1.2 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
{ 0.75f , - 0.75f , - 0.7 5f, 1.0f } , Color3 { 1.0f } , Color3 { 1.0f } ,
1.0f , 0.0f , { } }
1.0f , 0.0f , { } }
} ;
} ;
@ -1559,7 +1559,7 @@ void PhongGLTest::renderLightsSetOneByOne() {
/* First light is directional, from back, so it shouldn't affect the
/* First light is directional, from back, so it shouldn't affect the
output at all - - we only want to test that the ID is used properly */
output at all - - we only want to test that the ID is used properly */
. setLightPosition ( 0 , { - 1.0f , 1.5f , - 0.5f , 0.0f } )
. setLightPosition ( 0 , { - 1.0f , 1.5f , - 0.5f , 0.0f } )
. setLightPosition ( 1 , { 0.75f , - 0.75f , - 1.2 5f, 1.0f } )
. setLightPosition ( 1 , { 0.75f , - 0.75f , - 0.7 5f, 1.0f } )
. setLightColor ( 0 , 0x00ffff _rgbf )
. setLightColor ( 0 , 0x00ffff _rgbf )
. setLightColor ( 1 , 0xff8080 _rgbf )
. setLightColor ( 1 , 0xff8080 _rgbf )
. setLightSpecularColor ( 0 , 0x0000ff _rgbf )
. setLightSpecularColor ( 0 , 0x0000ff _rgbf )