Page 1 of 1

Adding vertices to appendGeometry()

Posted: Wed Oct 28, 2009 23:41
by hermit purple
When ImageSet:: draw() calls appendGeometry, it pass six vertices. The last 2 being the diagonal vertex. Is there a particular reason why we pass 6 vertex instead of 4. My system will be using quad so the last 2 vertices seems redundant. Am I safe to just ignore the last 2 vertices?

Also, correct me if I'm wrong, this looks like the only place appendGeometry getting called, meaning the only place vertices are added.

Re: Adding vertices to appendGeometry()

Posted: Mon Nov 02, 2009 21:32
by Jamarr
I believe CEGUI uses GL_TRIANGLES for drawing, thus why you need 6 verticies to draw a quad. If you only supply 4, your textures will not be mapped properly. You'll have to wait for CE to get back for a definitive answer.

Re: Adding vertices to appendGeometry()

Posted: Thu Nov 05, 2009 08:40
by scriptkid
I managed to tackle CE about this, and this is a reply on his behalf:

Currently the GeometryBuffer only supports the concept of a triangle
list for the added geometry. This was chosen for the initial
implementation for simplicity reasons and because it matches the
rendering approach in the pre 0.7.x versions; or to put it another way,
initially we've only been interested in getting it to do what CEGUI
needed in a way that would be supported by the maximum number of APIs
and engines.

If you're going to be adding your own custom geometry to GeometryBuffer
objects, then currently the data passed in must also be in the form of a
triangle list - because this is the only primitive type understood by
the current implementations of GeometryBuffer. At some stage the
interface for GeometryBuffer will be enhanced to accept other primitive
types and probably a facility for indexed data also (though no ETA is
given for such enhancements).

You are correct that within the core CEGUI components, the
Imageset::draw function is currently the only place geometry is added to
GeometryBuffer objects. This basically highlights the way rendering is
done within CEGUI; that currently everything drawn is Imageset based.

HTH :)

Re: Adding vertices to appendGeometry()

Posted: Wed Jun 02, 2010 22:57
by jays
Good evening,

I'm writing a renderer Geometry Buffer class and wanted to check if this information is still accurate.
I assumed the vertices passed to me in appendGeometry() were a list of triangles.
Can I also assume they are all built in the same order so I don't need to worry about unifying all the normals?
I wouldn't want half of it to be invisible because I'm looking at the backs of the triangles.

Thanks!

Re: Adding vertices to appendGeometry()

Posted: Thu Jun 03, 2010 09:00
by CrazyEddie
The info quoted by scripkid is still current.

You shouldn't have to worry about normals and such, though you should also not do back-face culling for the GUI content, because you may have rotated content and such which gives the possibility of requiring back faces to be seen.

HTH

CE.

Re: Adding vertices to appendGeometry()

Posted: Fri Jul 23, 2010 17:29
by jays
Thanks for the help CE and ScriptKid.

The docs I've read say " The GeometryBuffer is passed Vertex objects to be added to the internal buffer(s). The
geometry that CEGUI supplies is position independent, with the origin being the top-left corner"

The OpenGL origin is typically lower left corner. Looking at the OpenGl renderer I don't see any code to adjust the origin.
What did I miss?

Re: Adding vertices to appendGeometry()

Posted: Sat Jul 24, 2010 07:18
by CrazyEddie
IIRC it's inverted as part of the projection.

CE.