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: Triangle performance problem



Hey,
Have you tried OpenGL Profiler? It will give specific information about which operations are taking more time. In this case, I would guess that GL state changes are your issue. Try caching GL state across your program, only changing it when necessary, or reordering your drawing order to put similar states together. 

Hope this helps,
Steven Canfield

On May 18, 2009, at 4:43 AM, Space Ship Traveller <email@hidden> wrote:

Hi

Here are my specs:

  Model Name: MacBook Pro
  Model Identifier: MacBookPro4,1
  Processor Name: Intel Core 2 Duo
  Processor Speed: 2.5 GHz
  Number Of Processors: 1
  Total Number Of Cores: 2
  L2 Cache: 6 MB
  Memory: 4 GB
  Bus Speed: 800 MHz

GeForce 8600M GT:
  Bus: PCIe
  PCIe Lane Width: x16
  VRAM (Total): 512 MB

I'm aiming for 60FPS. I'm drawing textured triangles. which are alpha blended:

glVertexPointer(3, GL_FLOAT, 0, &m_vertexArray[0]);
glEnableClientState(GL_VERTEX_ARRAY);


glTexCoordPointer(2, GL_FLOAT, 0, &m_texCoordArray[0]);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);


glColorPointer(4, GL_FLOAT, 0, &m_colorArray[0]);
glEnableClientState(GL_COLOR_ARRAY);


glDisable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);


std::cout << "Drawing " << m_vertexArray.size() / 3 << " triangles." << std::endl;
glDrawArrays(GL_TRIANGLES, 0, m_vertexArray.size());


glDisable(GL_COLOR_MATERIAL);
glEnable(GL_DEPTH_TEST);


glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);

I can't seem to render more than 2000 triangles without running into performance problems. This seems fairly small. Is this just something I'm doing incorrectly?

Kind regards,
Samuel

_______________________________________________
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
 _______________________________________________
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

References: 
 >Triangle performance problem (From: Space Ship Traveller <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.