So, I'm making, um, a dual stick shooter that will look somewhat similar to Geometry Wars. (In my defense, it will play completely differently.)
But there's an issue. This is what I'm currently rendering.
This is what Geometry Wars looks like.
Look at where the lines intersect. In mine, they just blend to a brighter color. In Geometry Wars, they blend to white. How does it do that?
Originally, I had the color set to glColor4f(0.0f,1.0f,0.0f,1.0f), and I couldn't tell that there was any blending going on at all. I'd assumed that when the two greens summed to more than 1.0f, the remainder would be distributed among the other two colors, so that the render would effectively be using glColor4f(0.5f,1.0f,0.5f,1.0f) where the lines intersected. How would one go about setting it up to work like that? Would I have to learn how to write a shader?
Here's where I initialize the relevant stuff in my code:
glDisable(GL_DEPTH_TEST);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
glEnable(GL_LINE_SMOOTH); //antialiasing
glEnable(GL_BLEND); // Turn Blending On
glBlendFunc(GL_ONE, GL_SRC_ALPHA); //Additive blending
Here's my drawing function:
glColor4f(0.0f,0.7f,0.7f,1.0f); //Aqua
glLineWidth(3.0f);
glPushMatrix();
glTranslatef (x, y, 0.0);
glRotatef(angle, 0.0, 0.0, 1.0);
glBegin(GL_LINE_LOOP);
std::list<Coord>::iterator it;
for(it = points.begin(); it != points.end(); ++it) {
glVertex2f(it->x, it->y);
}
glEnd();
glPopMatrix();