Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Indexed primitives vs. non indexed

chick80chick80 Member Posts: 349
I started using indexed primitives to render a scene. I chose to use indexed as they should be faster than non indexed. Now I found myself in front of this problem: how do I calculate normals???
As I have 1 normal entry for each vertex I will calculate that normal interpolating the normals of all the faces the vertex is part of.
Due to this fact the shading is quite orrible...
I found only 2 solutions to this: do shading in a vertex/pixel shader (I don't want to use them for now...) and putting a degenerate face beetween each pair of faces.
Does someone know a better way to do this or should I turn back to non indexed?

nICO

[hr]
[italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
JOHN KEATS

Comments

  • chick80chick80 Member Posts: 349
    I did not explain myself right... the real problem was that interpolating the normals gives you a smooth result, and if you need hard or partially hard edges it is not a good result...

    Anyway I solved the problem using non indexed primitive, also because they're better for some other aspects of my program.

    Thank you for the answer!
    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


Sign In or Register to comment.