VBOs without the V.

Hi,

I’ve been playing around with VBOs a bit, and I’ve got a Cg vertex shader positioning the vertex based on other information than the vertex position (e.g. texture reads). However, it doesn’t like it that I don’t specify a glVertexPointer (it doesn’t draw anything). I couldn’t find any information about this, but I guess I must’ve overlooked something, do I have to specify a glVertexPointer?

Thanks.

Yes, without it the setup is incomplete and it won’t work.

Jan.

Interesting… Why is that? :slight_smile: When I read documentation for a bunch of stuff, there are usually defaults given for everything , I guess I just assumed x, y, z and w had the defaults 0, 0, 0 and 1 (just like s, t, r and q for texcoord), now that I look again, it appears only z and w have defaults (0 and 1).

For now, I’m using the same buffer for texcoords and vertices could that pose a problem on some architectures? Of course, I could just scrap the texcoords and use the position in this case, but I mean generally.

Thanks!

no, vertex data has no defaults, and if it did it would only be in immediate mode, but even then you actually have to pass vertex coordinates to render things, rendering the whole question about vertex position defaults moot.
(z and w only have defaults if you use vec2 or vec3 data)

Vertex position is by definition the very least thing you need to pass to the vertex shader, even if that data is just garbage or taken from another unrelated source.
I suggest you use it if you can.

You do not need to use glVertexPointer provided that you have generic vertex attribute array (glVertexAttrib) bound (and enabled) to generic attribute 0. Those two things are required to be equivalent by the specification.

also if you call glVertexPointer just once with valid data then this data will be used the whole time unless told otherwise. you simly specify the vertex stream here because different geometry has obviously different vertices.