# Thread: Vertex Arrays and Normals

1. ## Vertex Arrays and Normals

Simple Question:

Using Vertext Arrays, I can send 8 vertices and 36 indexes to render a cube without lighting. If I want to light the cube, do I need to send 24 vertices and 24 normals and 36 indexes?

Thank you for any info

2. ## Re: Vertex Arrays and Normals

Whichever way you choose to render an object, for VA's you will have 1 normal per vertex, 1 tex coord (Tex Unit 0) per vertex, etc

Right now you have chosen not to share vertices across faces, so normal interpolation is not what you want Im assuming.

PS: accelerating cubes was actually suggested in opengl in the suggestions section. Shot dead on the spot!

V-man

3. ## Re: Vertex Arrays and Normals

I would like to share vertices across faces, but the shared vertex would have a different normal for each face. How can I share vertexes across faces and still have the proper normal used?

4. ## Re: Vertex Arrays and Normals

You can't.
You'll have to have duplicate vertices.

5. ## Re: Vertex Arrays and Normals

Thats what I was afraid of.

I am loading a .3ds file that stores shared vertices along with the face indexes. It does not store the normals, so to render it I was going to "unshare" the vertices, generate the normals, and send everything in an expanded form. Is there any way to have OpenGL calculate the normals for me automaticially? That way I will only send the shared vertices and the indexes?

Thanks again for any help

6. ## Re: Vertex Arrays and Normals

My question really is do I have to specify vertex normals to use lighting?

7. ## Re: Vertex Arrays and Normals

as lighting depends on the surface normal of each pixel (or in gl of each vertex), yes

don't be afraid of it..

8. ## Re: Vertex Arrays and Normals

For organic models (smooth surfaces) you will probably want to average normals for a shared vertex of neighboring sufaces.

For non-organic models (a cube), you will be forced to duplicate vertices.

Maybe Studio Max has some output feature for "unsharing vertices"???

V-man

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•