Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#167 Blending issue ?

open
nobody
Defect (99)
5
2006-09-19
2006-09-19
Anonymous
No

A project that I'm working on draws triangles with
missing pixels and other artifacts. The code works
100% on rasteroid. This is an extraction that shows
one example of a misdrawn triangle. Any help would be
much appriciated!!!!

Thanks,
Ryan

int mmat[16] = { 0xfffc, 0, 0, 0,
0, 0x1efa, 0xffff01e9, 0,
0, 0xfe1b, 0x1efa, 0,
0, 0xffffff1e, 0xfffffbfe, 0x10000
};

#define left -0.00015258789f
#define center 0.0f
#define right 0.00015258789f
#define front 0.00045776367f
#define back -0.00045776367f
#define top 0.000076293945f

float colors[] = { 0, 0, 1, 1,
1, 1, 1, 1,
0, 0, 1, 1
};

short indices[] = { 0, 2, 1 };

float vertices[] = { left, back, top,
center, front, top,
right, back, top };

glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustumf(-.0021651071f,
.0021651071f,
-.0021651071f,
.0021651071f,
.0080831982f,
.23831205f);
glViewport(0,0, 0x400, 0x300);

glMatrixMode(GL_MODELVIEW);
glLoadMatrixx(mmat);

glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glShadeModel(GL_SMOOTH);

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, (void const*)vertices);
glColorPointer(4, GL_FLOAT, 0, (void const*)colors);

glDrawElements(GL_TRIANGLE_STRIP, 3,
GL_UNSIGNED_SHORT, indices);

glFinish();

eglSwapBuffers(g_display, g_surface);

Discussion

  • Logged In: NO

    contextrender.cpp ln 828:
    // Scale 1/Z by 2^12 to avoid rounding problems during
    prespective correct
    // interpolation
    pos.m_WindowCoords.invW = invDenominator << 12;

    This clips off the top of invDenominator.
    What is the proper why of handling this? Should it ever get
    here with out being a valid point to transform?

    Thanks

     
  • Logged In: YES
    user_id=618887
    Originator: NO

    I have just been looking at this code again. My first guess is that the viewport exceeds the maximum supported resolution, and what you are seeing are overflow problems [which PDA has 1024*768 resolution?].