Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vertex buffer objects



hi ron,
I didn't see a glEnableClientState(GL_COLOR_ARRAY) call in your code - could this be the problem?


matthias

Message: 1
Date: Mon, 27 Sep 2004 01:39:54 -0700
From: Ron Avitzur <email@hidden>
Subject: vertex buffer objects
To: email@hidden
Message-ID: <p0610050abd7d8253d0ab@[192.168.1.100]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Hello,

My application is exhibiting some difficult to diagnose bugs which show
up only when rendering using vertex buffer objects using glColorPointer
on machines with nVidia video.

Since this is both new code, and the first time I've used VBOs, there
are many possibilities where I may have misunderstood something and
introduced the problem. At the moment I'm developing on machines
with Radeon chips which do not exhibit the bug, making it more
difficult to diagnose. One possibility I am unsure of from reading
the VBO spec, is whether the problem could be caused by using one
VBO for the vertex and normal data, and another VBO for the color
array data.

Is that something which I should only expect to work on ATI chips?

int stride        = sizeof(Vertex) * (fInterleaved ? 2 : 1);
int normalsOffset = sizeof(Vertex) * (fInterleaved ? 1 : fNumVertices);

glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, fIndexBufferObjectID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, fVertexBufferObjectID);
glVertexPointer(3, GL_FLOAT, stride, (char*)NULL + 0);

if (fUseNormals) {
   glEnableClientState(GL_NORMAL_ARRAY);
   glNormalPointer(GL_FLOAT, stride, (char*)NULL + normalsOffset);
   }

if (fColorBufferObjectID) {
   glBindBufferARB(GL_ARRAY_BUFFER_ARB, fColorBufferObjectID);
   glColorPointer(3, GL_FLOAT, sizeof(ColorArrayElement), NULL);
   }


Is anyone here aware of differences in implementation or support with respect to vertex buffer objects between ATI and nVidia that might help me narrow down diagnosing the problem?

Best regards,

Ron Avitzur


------------------------------

Message: 2
Date: Mon, 27 Sep 2004 11:36:08 -0700
From: Ron Avitzur <email@hidden>
Subject: multiple vertex buffer objects
To: email@hidden
Message-ID: <p06100514bd7e0c9662fe@[192.168.1.100]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Hello,

I tried putting all the array data into one vertex buffer object,
and that seems to have fixed the problem I was seeing. So my next
questions, in an attempt to tell if I've actually corrected the bug,
or merely made it more difficult to reproduce:

1. Does the spec require implementations to support code such as that
   below, which binds one VBO before calling glVertexPointer, then
   binds another VBO before calling glColorPointer, and the calls
   glDrawElements?

2. If that is allowed by the spec, have I hit a known problem with
   the nVidia drivers on 10.3.5 or might I have made some other
   errors as well which I should investigate?

Before I report this, I'd like to know if it is actually a bug,
or if I've merely misinterpreted the VBO spec.

Best regards,

Ron Avitzur




My application is exhibiting some difficult to diagnose bugs which show
up only when rendering using vertex buffer objects using glColorPointer
on machines with nVidia video.

Since this is both new code, and the first time I've used VBOs, there
are many possibilities where I may have misunderstood something and
introduced the problem. At the moment I'm developing on machines
with Radeon chips which do not exhibit the bug, making it more
difficult to diagnose. One possibility I am unsure of from reading
the VBO spec, is whether the problem could be caused by using one
VBO for the vertex and normal data, and another VBO for the color
array data.

Is that something which I should only expect to work on ATI chips?

int stride        = sizeof(Vertex) * (fInterleaved ? 2 : 1);
int normalsOffset = sizeof(Vertex) * (fInterleaved ? 1 : fNumVertices);

glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, fIndexBufferObjectID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, fVertexBufferObjectID);
glVertexPointer(3, GL_FLOAT, stride, (char*)NULL + 0);

if (fUseNormals) {
  glEnableClientState(GL_NORMAL_ARRAY);
  glNormalPointer(GL_FLOAT, stride, (char*)NULL + normalsOffset);
  }

if (fColorBufferObjectID) {
  glBindBufferARB(GL_ARRAY_BUFFER_ARB, fColorBufferObjectID);
  glColorPointer(3, GL_FLOAT, sizeof(ColorArrayElement), NULL);
  }


Is anyone here aware of differences in implementation or support
with respect to vertex buffer objects between ATI and nVidia that
might help me narrow down diagnosing the problem?




------------------------------

_______________________________________________
Mac-opengl mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/mac-opengl

End of Mac-opengl Digest, Vol 1, Issue 16
*****************************************




--
matthias specht
| mailto:email@hidden  http://www.ifi.unizh.ch/staff/specht
office
| multimedia lab, computer science department, university of zurich
| winterthurerstr. 190, 8057 zurich, switzerland
| phone +41-1-635-4565 fax +41-1-635-6809

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.