Blending -> Black Lines Through Textures (Wireframe like)

Member
Posts: 153
Joined: 2004.12
Post: #1
Enabling blending makes all my textures have these weird black lines go through them. Kinda like a wireframe, if my mesh where triangulated. Heres a pic: Screenie

Again this only happens when i enable blending.

Iv tried:

Nearly every possible combination of texture filtering.
Changing my materials... enabling/disabling... no change.
Changing the blending function...
Clamping my textures...
enabling mipmaps...
changing the texture enviroment...

Some relevant code:
Code:
//Blending
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


Code:
//texture generation
        glBindTexture(GL_TEXTURE_2D, textureId);

        glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);

        glTexImage2D( GL_TEXTURE_2D, 0, 3, size.width,
                    size.height, 0, glFormat,
                    GL_UNSIGNED_BYTE, bytes );
                                
        // Linear filtering
        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
        
        glTexEnvi(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, -3);
        glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);

Code:
//Model Rendering
    if([textures count])
        glBindTexture(GL_TEXTURE_2D, [[textures objectAtIndex:0] tId]);
    else
        glBindTexture(GL_TEXTURE_2D, 0);
    
    glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,  [mat get:LC_DIFFUSE]);
    glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,  [mat get:LC_AMBIENT]);
    glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, [mat get:LC_SPECULAR]);
    glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, [mat get:LC_EMISSIVE]);
    
    [self calculateAbsoluteVertices];
    glMultMatrixf((GLfloat*)finalMatrix);
    
    if([self useVertexArrays])
    {  
        glVertexPointer(3,GL_FLOAT,0,vertices);
        glNormalPointer(GL_FLOAT,0,normals);
        glTexCoordPointer(2,GL_FLOAT,0,uvVertices);
        glDrawArrays(drawType,0,nPoints);
    
    } else {

Thanks in advanced.
-Joe

There was a long silence...
'I claim them all,' said the Savage at last.
Quote this message in a reply
Member
Posts: 153
Joined: 2004.12
Post: #2
if i disable materials/textures it still happens...

EDIT: Having glEnable(GL_POLYGON_SMOOTH); was doing it. So my question becomes... Is there anyway to use Polygon smoothing and blending at the same time?

There was a long silence...
'I claim them all,' said the Savage at last.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #3
hangt5 Wrote:Having glEnable(GL_POLYGON_SMOOTH); was doing it. So my question becomes... Is there anyway to use Polygon smoothing and blending at the same time?

Sadly, no. See Arekkusu's explanation in this thread.

- Alex Diener
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Discrad black parts in texture bonanza 7 5,710 Oct 27, 2011 01:05 AM
Last Post: bonanza
  Fade Particle to black bonanza 8 5,381 Apr 3, 2008 05:24 AM
Last Post: bonanza
  general blending versus texture blending questions WhatMeWorry 2 5,156 Dec 7, 2006 02:43 PM
Last Post: arekkusu
  n00b question: getting rid of lines along edges of polygons Andrew 2 2,727 Jun 5, 2005 05:57 PM
Last Post: Andrew
  Black Bumpmaps Rassilon 2 2,992 Apr 12, 2005 04:43 AM
Last Post: isgoed