|
From: Frank C <li...@si...> - 2004-06-04 17:57:24
|
On 2-Jun-04, at 2:15 PM, Joseph J. Strout wrote:
> 2. Color/alpha modulation on textured geometry. Even just matching
> QD3D's functionality would be welcome:
Here are some changes to get QD3D 1.6 behavior:
---
In IRGeometryTriMesh.c, ir_geom_trimesh_initialise, get rid of the
"TEMPORARY FIX" block.
---
In IRGeometry.c, IRGeometry_Generate_Vertex_State, add a "white" const:
const TQ3ColorRGB white = {1.0f, 1.0f, 1.0f};
Then in the "Fall back to the defaults" bit change this:
if (colourDiffuse == NULL || instanceData->stateGeomHilightState ==
kQ3On)
colourDiffuse = instanceData->stateGeomDiffuseColour;
if (colourTransparency == NULL &&
(instanceData->stateGeomTransparencyColour->r != 1.0f ||
instanceData->stateGeomTransparencyColour->g != 1.0f ||
instanceData->stateGeomTransparencyColour->b != 1.0f))
colourTransparency = instanceData->stateGeomTransparencyColour;
to:
if (instanceData->stateTextureActive &&
instanceData->stateViewIllumination != kQ3IlluminationTypeNULL)
{
colourDiffuse = &white;
colourTransparency = &white;
}
else
{
if (colourDiffuse == NULL || instanceData->stateGeomHilightState ==
kQ3On)
colourDiffuse = instanceData->stateGeomDiffuseColour;
if (colourTransparency == NULL &&
(instanceData->stateGeomTransparencyColour->r != 1.0f ||
instanceData->stateGeomTransparencyColour->g != 1.0f ||
instanceData->stateGeomTransparencyColour->b != 1.0f))
colourTransparency = instanceData->stateGeomTransparencyColour;
}
---
In IRLights.c, ir_light_reset, change:
if (numLights != 0)
to:
if (numLights != 0 && instanceData->stateViewIllumination !=
kQ3IlluminationTypeNULL)
---
In IRTexture.c, ir_texture_set_state, remove the glEnvMode variable and
the "if" statement that sets it, then change:
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, glEnvMode);
to:
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
I think that's everything - This can be verified to work with all
geometries using GeomTest (i.e. it should fix both trimesh and
tribuffer rendering)
Frank.
|