Particles are forced to set to glColor4f(1,1,1,1) unexpectedly
by terrykim426 · in Torque Game Builder · 09/25/2012 (9:48 pm) · 1 replies
Hi,
I am currently having a problem with the particles color.
It worked normally until I moved the camera higher up, the particles will somehow be forced to set the RGBA to all 1. The Y position of the camera is consistent at a point to trigger the bug within the same level scene, but the Y position to trigger the bug, will be different in other scenes.
I tried directly added the lines to change the color to values other than glcolor4f(1,1,1,1) in the renderObject() in t2dParticleEmitter.cc like this:
The moment I crossed the bug triggering Y position, it will force all particles to glcolor4f(1,1,1,1);
I tried to search around the source codes, but I'm quite lost at where is the code that is affecting the particles.
Any help on this, will be much appreciated =).
I am currently having a problem with the particles color.
It worked normally until I moved the camera higher up, the particles will somehow be forced to set the RGBA to all 1. The Y position of the camera is consistent at a point to trigger the bug within the same level scene, but the Y position to trigger the bug, will be different in other scenes.
I tried directly added the lines to change the color to values other than glcolor4f(1,1,1,1) in the renderObject() in t2dParticleEmitter.cc like this:
// Draw Object.
glBegin(GL_QUADS);
glColor4f (1,0,0,0.3);
glTexCoord2f( minX, minY );
glVertex2fv ( (GLfloat*)&(pParticleNode->mLocalClipBoundary[0]) );
glColor4f (1,1,1,0.3);
glTexCoord2f( maxX, minY );
glVertex2fv ( (GLfloat*)&(pParticleNode->mLocalClipBoundary[1]) );
glColor4f (0,0,1,0.3);
glTexCoord2f( maxX, maxY );
glVertex2fv ( (GLfloat*)&(pParticleNode->mLocalClipBoundary[2]) );
glColor4f (0,1,0,0.3);
glTexCoord2f( minX, maxY );
glVertex2fv ( (GLfloat*)&(pParticleNode->mLocalClipBoundary[3]) );
glEnd();The moment I crossed the bug triggering Y position, it will force all particles to glcolor4f(1,1,1,1);
I tried to search around the source codes, but I'm quite lost at where is the code that is affecting the particles.
Any help on this, will be much appreciated =).
terrykim426
I have just tested that its only happening in the default scenegraph.
And it may not be just Y-axis that causing the problem. At some other level, moving over some X-axis would cause the same problem as well.