vertex attributes how to?

Problems building or running the engine, queries about how to use features etc.
Post Reply
hall
Halfling
Posts: 41
Joined: Sat Dec 01, 2012 12:47 am

vertex attributes how to?

Post by hall »

Just curious, how is this done in ogre? Suppose I have a mesh, I'd like to attach some attributes to each vertex. I'd like to do a little manipulation of (gl_Vertex + attribute) before I calculate gl_Position.

1. how do I create an attribute
2. most important, how do I assign values to attributes. These are going to be changed every frame.

In fact, I'm curious, I see that in scripts you can hard code uniforms/attributes/etc, how do I programmatically change the values. All of my work will be in opengl.

Thanks
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: vertex attributes how to?

Post by dark_sylinc »

See binding vertex attributes.

In HLSL, you just use the POSITION, NORMAL, TANGENT, COLOR and TEXCOORDn semantics.
hall wrote:2. most important, how do I assign values to attributes. These are going to be changed every frame.
An "attribute" is a component of the vertex. Their values come from vertex buffers (i.e. the meshes).
To modify them you need to map a HardwareVertexBuffer pointer. This can be quite a large topic.
See the wiki.
Post Reply