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.
Adding vertices to appendGeometry()
Moderators: CEGUI MVP, CEGUI Team
-
- Just popping in
- Posts: 13
- Joined: Wed Oct 21, 2009 20:21
Re: Adding vertices to appendGeometry()
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.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: Adding vertices to appendGeometry()
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
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
Check out my released snake game using Cegui!
Re: Adding vertices to appendGeometry()
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!
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!
-- Doctor Doctor, it hurts when I ....
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Adding vertices to appendGeometry()
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Adding vertices to appendGeometry()
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?
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?
-- Doctor Doctor, it hurts when I ....
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Adding vertices to appendGeometry()
IIRC it's inverted as part of the projection.
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Bing [Bot] and 0 guests