Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Anybody know how to use "get vertexdata ptr" ?

Author
Message
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Aug 2012 15:17 Edited at: 14th Aug 2012 19:11
As the title suggests, I'm thinking about trying to read / write to the vertex buffer directly to avoid the function calling overhead.

I know the function returns a pointer to the sMesh structure:


However when browsing through the first few bytes of the pointer, it seems to hold 4 reserved bytes first and then the standard "memblock mesh" header (fvf format, fvf size...), none of which I can find directly in the above sMesh struct.

sMesh seems to be defined in multiple files (not just forward declared but actually redefined); is it possible that the various structs differ from each other?


Maybe someone have some experience with this already (IanM?) and can shed some light on the situation?

Thanks in advance,
Rudolpho




Edit: For anyone reading this considering going down this route I certainly recommend it.
My benchmarking test went up in running speed slightly above 200% when doing this (from 174 FPS using the built-in functions to 395 using the buffer directly).


"Why do programmers get Halloween and Christmas mixed up?"
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Aug 2012 18:18
Ah, think I figured it out... there is a more extensive sMesh definition in DBOData.h that seems to be the correct one.


"Why do programmers get Halloween and Christmas mixed up?"
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Aug 2012 02:11
I hope I can utilise this, I saw this before you posted your update... have been silently tracking this all day...

Login to post a reply

Server time is: 2026-07-21 20:35:05
Your offset time is: 2026-07-21 20:35:05