Game Development Community

Problem with Lighting Resource

by Jason Gossiaux · in Torque Game Engine · 10/21/2007 (11:15 pm) · 1 replies

Howdy all,

I was attempting to modify my object selection by changing the bounding box example into the colorblend highlight example found here

Now, I followed the instructions and added the TGE 1.5 Resource kit found here I made all the code modifications indicated in the shapeBase.cc file, then I did a full rebuild without errors.

I can see the code getting to the correct spot in the debugger where the blending is being set. I can even see it hitting this code:

void sgLightingModelGLBase::sgSetState(LightInfo *light)
{
	sgLightingModel::sgSetState(light);

	sgConstantAttenuation = 0;
	sgLinearAttenuation = 0;
	sgQuadraticAttenuation = 0;

	sgLightParamDiffuse = Point4F(light->mColor.red * LightManager::sgGlobalBlendColor.red,
		light->mColor.green * LightManager::sgGlobalBlendColor.green,
		light->mColor.blue * LightManager::sgGlobalBlendColor.blue,
		1.0f * LightManager::sgGlobalBlendColor.alpha);

	sgLightParamAmbient = Point4F(light->mAmbient.red * LightManager::sgGlobalBlendColor.red,
		light->mAmbient.green * LightManager::sgGlobalBlendColor.green,
		light->mAmbient.blue * LightManager::sgGlobalBlendColor.blue,
		1.0f * LightManager::sgGlobalBlendColor.alpha);

    sgLightParamPosition = Point4F(light->mPos.x, light->mPos.y, light->mPos.z, 1.0f);
    sgLightParamDirection = Point4F(-light->mDirection.x, -light->mDirection.y, -light->mDirection.z, 0.0f);
}

with the correct RGB values being set (to 5.0 in my case). However nothing changes in the engine. Any help would be appreciated. I saw some others were having trouble in TGE 1.5.2 but I have no idea if they ever got it working. Thanks!

#1
11/01/2007 (3:08 am)
How bright is your mission lighting? If the lighting is already maxed out you won't see any additional blend unless you use it to remove some of the intensity (try: 5.0, 0.1, 0.1 to see if it's working).