Issues after upgrading to 0.7.1 renderer

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Issues after upgrading to 0.7.1 renderer

Postby Nitro » Mon Dec 07, 2009 16:16

Hello,

I've upgraded to cegui 0.7.1 from 0.6.2. In the process I had to rewrite the renderer module so it would use my own renderer. Upgrading to the new system went quite smooth, except for three issues:


Issue 1) Antialiased text blends over the background.
---

Here's a screenshot: Image

Take a very close look at the text. Some of it appears blue, some reddish/white.

How does this happen?

- CEGUI clears the render target to color(r=0,g=0,b=0,a=0).
- Then it renders the window background, output is a pixel with the window background color, e.g. color (r=0.5,g=0.5,b=0.5,a=1).
- Next it renders the text with blending enabled and blending function set to SrcAlpha, InvSrcAlpha.Say the color of pixel of the font is (1,1,1,0.25). Now this blends with the already present pixel in the render target to 0.25 * (1,1,1,0.25) + 0.75 * (0,0,0,0) = ( 0.25, 0.25, 0.25, 0.06 ). This means the final pixel in the render target is almost transparent (alpha=0.06).
- The window render target is bound as a texture and rendered over the background. Since some pixels are almost transparent, they will blend with the background. This results in the strange text colours you can see in the screenshot.

How do you fix this? Use SeparateBlendEnable = true and DstAlpha = One? Or is there another recommendation?


Issue 2): Perspective matrix
----

Why do the default renderers use a perspective projection matrix instead of an orthographic one? Is this to show off 3d rotation of windows? Or is this important in other respects, too?


Issue 3):
----

injectMouseMove(0,0) did not work anymore, had to use something like system->injectMouseMove(1e-5f, 1e-5f). This is not dramatic though and probably better than the behaviour before. Just a change that I didn't see documented.

-Matthias

P.S.: CEGUI is a really great library :)
P.P.S.: The main page http://www.cegui.org.uk seems to be down for me since a few days; it gives an error message.

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Re: Issues after upgrading to 0.7.1 renderer

Postby Nitro » Mon Dec 07, 2009 16:18

Oh, and a last question. Say I create 1000 windows. Will CEGUI create a render target for each of them?

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Re: Issues after upgrading to 0.7.1 renderer

Postby Nitro » Tue Dec 08, 2009 12:24

Ok, I tried creating lots of windows and this causes tons of render targets to be created. I also noticed that resizing a window which uses a render target is sluggish. Tried setting setUsingAutoRenderingSurface(false), but it doesn't seem to have any effect.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Issues after upgrading to 0.7.1 renderer

Postby CrazyEddie » Tue Dec 08, 2009 14:35

Hi,

1) This issue exists in all the renderers at the moment. It's definitely blend related (obviously), though I'm not sure how to fix it right now.

2) This is basically to support rotation, yes.

3) What do you mean it did not work? Surely injectMouseMove(0,0) is a NOOP?

With regards to the wiki / front page it's due to caching employed - whenever the site errors the cache gets updated and stays like it! adding ?action=purge to the URL will purge the cache ;)

With regards to the creation of render targets, this is something controlled by either the application or more likely the looknfeel, the only circumstances under which a target will be created for a window is if it's enabled by the user, if it's set in the looknfeel or if the window has rotation set. The default looknfeel definitions will only create a target for the FrameWindow - nothing else, if you're seeing something else then there's an issue in your renderer.

CE.

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Re: Issues after upgrading to 0.7.1 renderer

Postby Nitro » Wed Dec 09, 2009 11:36

Hey CrazyEddie,

Thanks for your reply!

Regarding 3) I mean it wasn't a noop before and now it is. Not important at all.

Regarding the render targets, yes I was using frame windows with the default looks, so I got the situation that you describe. But now that I know how this part works, I can use it appropriately :-)

Thanks for all your work on cegui! It's by far the highest-quality library in the set of libraries we are using.

-Matthias

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Issues after upgrading to 0.7.1 renderer

Postby CrazyEddie » Thu Dec 10, 2009 10:00

Thanks for the kind words, it's always nice to hear that we've generally done a good job with the lib :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Issues after upgrading to 0.7.1 renderer

Postby CrazyEddie » Fri Dec 18, 2009 18:50

Hi,

Just to confirm that the alpha / blending issue should now be fixed for all renderers except Irrlicht (which apparently does not support separate blend modes for colour / alpha - I will confirm that, and then find a work around if possible). And the solution was was pretty much as you suggested.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests