OGL Question: Are all vertex sent to de GPU?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
casty
Posts: 11
Joined: Sun Aug 27, 2006 10:40 am

OGL Question: Are all vertex sent to de GPU?

Post by casty »

Hi,

If I have an SceneNode::render() like this:

Code: Select all

#define NUM_VERTICES 4
...
video::S3DVertex Vertices[NUM_VERTICES];
...
u16 indices[] = {0,2,1};
driver->drawIndexedTriangleList(&Vertices[0], NUM_VERTICES, &indices[0], 1);
I wonder wheter vertices[3] will be processed in the GPU. irrlicht only sets its color to glColor and calls glDrawElements, but I don´t know what happens then.

BTW: my triangle disapears when NUM_VERTICES is > 65536 (with 65536 it is shown).
casty
Posts: 11
Joined: Sun Aug 27, 2006 10:40 am

Post by casty »

Ok, the 65536 limit is because there is a Maximal Primitive Count set to 65536.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Irrlicht packs vertices into buffers before sending them to the gpu, this reduces the number of calls thus reducing the possiblity of the application becoming driver bound. and thus the lack of glvertex calls in the opengl driver source code.

Irrlicht can render over 65536 polygons without mods the polygons have to be in diffrent buffers. Its due to the integer variable that holds the numbers for the verts is a 32 bit one and thus has a 65536 limit a 64 bit one has double that limit.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It's the variable that holds the indices which point to vertices, and this is short int which makes it hold at most 65535, int would fix it to over 2 billion vertices. This is found under the topic 32bit patch.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

indexing verticies with a 64bit number gives you limit for verticies 65536*65536 :shock:
what is this thing...
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Actually it is 65536*65536*65536*65536.
65536*65536 is 32bit.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

no , I got it right
what is this thing...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, saturn is right. 65535 is 2^16. 65535*65535=2^16*2^16=2^(16+16)=2^32
You can easily derive 2^64 for the value saturn gave.
EmmanuelD
Posts: 25
Joined: Thu Aug 24, 2006 8:34 am
Location: Right in front of Dagoth Ur
Contact:

Post by EmmanuelD »

needforhint wrote:no , I got it right
2^64
= (2^32)*(2^32)
= (2^16)*(2^16)*(2^16)*(2^16)
= 65536*65536*65536*65536

So far, Saturn is right.
-- Emmanuel D.
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

gee, I thought 65536 = 2^36.
Wow, 65536*65536*65536*65536 that's some amount of verticies to have :lol:
what is this thing...
Post Reply