0.8 rendering changes proposal

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

0.8 rendering changes proposal

Postby Kulik » Tue Jan 04, 2011 00:52

Currently, CEGUI renders via GeometryBuffer and only supports quads.

GB holds translation, rotation, clipping and list of textures that are used when rendering. This is IMO the biggest problem of it. One geometry buffer can mean many many batches because it has numerous texture changes. You also can only change the texture, no other state settings. And to top it all, it's actually harder to implement renderers with this approach.

What I propose is to split this into 2 classes - RenderBatch (one batch only) and RenderState (holds state settings). RenderBatch knows which RenderState it wants to use. I am not sure about the names yet because RenderState could (for example) render the batch multipass and that doesn't play well with the name, I would appreciate ideas in this area. With this approach, we can easily get a hash of each of the state settings and if it's the same between 2 batches, we don't have to set it. Furthermore it gets easier to implement some sort of batching/merging in the future (this is not the point of this though).

RenderState will only support primitive type (triangles, quads, lines, perhaps points), translation, rotation (or matrix4x4 to be more generic?), clipping rect and at least one texture by default - this is what all render systems have to support. The RenderState classes will get created by the Renderer itself so they can be subclasses into something like OpenGLRenderState, OgreRenderState, etc... They will be PropertySets so you can define them via XML. And this is where all the power and fun lies in this. Ogre can for example add "VertexShader" as a property and you can put a shader source there. This is all very complicated, so it will need several iterations before the API is just right. Right now I don't feel that RenderState should allow multiple passes, I think there should be a class surrounding that all but there are concerns about CEGUI becoming a rendering engine and that certainly is something to avoid.

In the end will allow RenderEffects to be defined via XML.

If there is some interest in this, I will branch out and try to hack something together. Widgets will of course be able to queue more than one batch in their render method, so no rendering power is lost but a lot of it is gained.

Idea that incorporates rendering too much into CEGUI (I don't like this) - CEGUI::RenderMethod, inside it are CEGUI::RenderPass. CEGUI::RenderBatch has RenderMethod set in it. This is pretty realtime 3D centric and allows a lot of stuff and could even obsolete current RenderEffects.

Things that this will enable: vector graphics drawing (with triangles), making effects more convenient and possibly even portable across renderers, future rendering optimisations - batching.

feedback please..

User avatar
Mikademus
CEGUI MVP
CEGUI MVP
Posts: 130
Joined: Wed Mar 18, 2009 19:14

Re: 0.8 rendering changes proposal

Postby Mikademus » Tue Jan 04, 2011 15:17

The separation of state and batches brings on further possibility I'd like to suggest: delta state stacks. Usually, most state sets only twiddle a few parameters from the last set, and it would be very beneficial that the state stack handles this so only the changed settings need to be updated.

uelkfr
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Dec 14, 2010 16:57

Re: 0.8 rendering changes proposal

Postby uelkfr » Tue Jan 04, 2011 19:00

And maybe make choice to refuse to support fixed function pipeline and move towards unified shader model!? :D
But its too early because Mesa supports only OpenGL 2.1 :)

[*]OpenGL12Renderer[/*]
[*]OpenGL41Renderer[/*]
consider this please too
helper to newbies

"i help you, dear newbie
but nobody helps me!"

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: 0.8 rendering changes proposal

Postby Kulik » Tue Jan 04, 2011 21:51

uelkfr: By all means, anyone is free and encouraged to make a patch to support GL3/4 rendering but it probably won't be me (I could review it and commit if it turns up though :wink: ). You can do this with CEGUI 0.7 the same way DX10/11 renderer is done.

User avatar
Mikademus
CEGUI MVP
CEGUI MVP
Posts: 130
Joined: Wed Mar 18, 2009 19:14

Re: 0.8 rendering changes proposal

Postby Mikademus » Thu Jan 06, 2011 15:48

Tying in with what you said here, is this the time to reintroduce the idea of 3D coordinates everywhere? If that means we can have arbitrarily rotated windows, and widgets mapped to arbitrary geometry, then it should be done. Also, the 3rd coordinate can just be hidden from sight for all but the calls where it is of relevance.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: 0.8 rendering changes proposal

Postby Kulik » Thu Jan 06, 2011 19:22

By nobody liked that I meant CrazyEddie didn't like it, he actually removed all the Z coordinates everywhere a while back.

Lets start a rebellion group! We want 3D in CEGUI :lol:

User avatar
Mikademus
CEGUI MVP
CEGUI MVP
Posts: 130
Joined: Wed Mar 18, 2009 19:14

Re: 0.8 rendering changes proposal

Postby Mikademus » Fri Jan 07, 2011 16:11

Of course we do! Say we want to make some kind of Metroid-like interface, then the "window" can't be flat. I suppose it could be fixed in other ways like making the texture that CEGUI goes to a render target which is mapped to a piece of geometry, but I see no need to remove the possibility of using the third dimension natively.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests