Interior "bug" ?
by Chris \"Hobbiticus\" Weiland · in Torque Game Engine · 04/24/2003 (10:27 am) · 1 replies
I'm trying to get this darn daylight cycle working properly. I need to change the vertex colors of all vertecies that are visible to the outside. There's a SurfaceOutsideVisible surfaceMask that apparently does this. The debug render using this works fine, and if I replace the current render with the debug render, that works fine too.
All I'm adding is:
What I get is spontaneous effects, where some light correctly, and some light the opposite of what they should.
As I understand it, the interiors are rendered surface by surface. So, it would be possible for a surface test to see if it's visible from the outside and just modulate it by a precalculated color. But, apparently, that's not so.
The question is:
Am I just missing some mundane (SP?) detail, or do I have to go about making a color array to add into the existing vertex arrays in order to modulate vertices properly?
This is about the 3rd time I've asked, and I've researched this to death, but I can't get anywhere. So someone please respond so I get get this thing done and off my mind!
All I'm adding is:
if (rSurface.surfaceFlags & SurfaceOutsideVisible) glColor3f(DaylightCycle::getInteriorColor()); else glColor3f(1,1,1);
What I get is spontaneous effects, where some light correctly, and some light the opposite of what they should.
As I understand it, the interiors are rendered surface by surface. So, it would be possible for a surface test to see if it's visible from the outside and just modulate it by a precalculated color. But, apparently, that's not so.
The question is:
Am I just missing some mundane (SP?) detail, or do I have to go about making a color array to add into the existing vertex arrays in order to modulate vertices properly?
This is about the 3rd time I've asked, and I've researched this to death, but I can't get anywhere. So someone please respond so I get get this thing done and off my mind!
Torque Owner Mz
You're probably setting the colors back and forth a few times before you actually get to a flushprimitives call.
If you don't mind going slow, add a flush after every emitprimitive.
If you want to keep the speed up, you should probably write all the color values into an array before rendering and reference them with glColorPointer instead of glColor3f.