Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Using OpenGL1.1 (sadly) I'm trying to draw a cube, which is colored and alpha blended. It is instead showing up as opaque black. Even without including alpha in the color it still shows up as opaque black so I don't believe blending is the problem.

    @Override
public void doRender(Entity entity, double d0, double d1, double d2,
        float f, float f1) {
    assert(entity instanceof EntityExplosion);
    EntityExplosion explosion= (EntityExplosion) entity;


    glPushMatrix();
    glPushAttrib(GL_BLEND);
    glPushAttrib(GL_COLOR_MATERIAL);

    //glDepthMask(false);

    glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);//TODO fix

    glEnable(GL_COLOR_MATERIAL);//i dunno if this even does anything

    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    glColor3b((byte)0, (byte)255, (byte)255);//TODO fix


    glTranslated(d0, d1, d2);//trans whole thing

    for(NukeParticle p : explosion.particles){
        glPushMatrix();
        glTranslated(p.x, p.y, p.z);
        glCallList(callCube);
        glPopMatrix();
    }


    glPopAttrib();
    glPopAttrib();
    glPopMatrix();
}

This is being done during a Minecraft Entity Renderer, meaning that the current state of GL is for drawing shaded, textured polys. What attribs or whatever do I change so that I can draw the way I want to?

share|improve this question
1  
glDisable (GL_TEXTURE_2D) will disable texturing, but don't forget to re-enable it when done. –  Jimmy Shelter Apr 21 '13 at 19:49
    
Does having textures enabled disable glColor though? –  Khlorghaal Apr 22 '13 at 22:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.