0

A bit of context :

I'm working on a GPU emulator (the NV2A if you want to know) at the push-buffer level, and I'm trying to implement the drawing using OpenGL. The GPU commands that I have to emulate contain separate pointers for each vertex component (so positions are in an entirely different memory address than fog coordinates, colors, texture coordinates, etc.) Other data, like vertex component size, type and stride are also present in the push-buffer, but those are not really relevant to this question.

I've been reading about Vertex Array Objects, but as far as my tests go, the pointers you can set with glVertexAttribPointer should all be relative to a Vertex Buffer Object - something I would like to avoid, as I've already got a copy of the data in memory.

The question :

Is it possible in OpenGL to draw vertices using separate pointers (not managed by any OpenGL API) per vertex component? And how would the code look like, roughy?

PS: Since I'm emulating a GPU, I have to take vertex shader programs into account too. I haven't worked on these yet, so any suggestion on that is welcome too. TIA!

4
  • Are you going to use OpenGL in core profile or compatibility profile? Commented Feb 16, 2011 at 22:27
  • @shoosh: I don't even know what that means - I'm afraid I'm a OpenGL newbie. But maximum compatibility is my target - ATI, NVidia, and other mainstream cards on WinXP and up. Commented Feb 16, 2011 at 22:29
  • why do you want to avoid VBO? Commented Feb 17, 2011 at 13:59
  • @kvark : Since the vertex components are already in memory, I see no reason to spend memory on them twice (VBO's are actual buffers, right? So any filling must be done as a copy, costing twice the memory - and at a speed penalty too I presume.) Commented Feb 17, 2011 at 18:47

1 Answer 1

2

You don't need to use VBOs, glVertexAttribPointer takes a normal CPU-pointer if no VBO is bound (you can call glBindBuffer(GL_ARRAY_BUFFER, 0) to make sure). And yes, you can set up one address per attribute stream.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.