0.7.1 clipping issue

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

reacher
Just popping in
Just popping in
Posts: 8
Joined: Thu Apr 02, 2009 14:29

0.7.1 clipping issue

Postby reacher » Thu May 13, 2010 19:06

We use CEGUI for a basic console for our game engine. Our console is similar to the example console in the CEGUI Samples. It uses Taharez and is made up of:

DefaultWindow (created programatically)
--FrameWindow (console window)
----Listbox (text buffer)
----Editbox (text entry)
------Listbox (auto complete window)

The auto complete window is initially hidden when the console is displayed. As soon as the user types in character(s) that match a given set of commands, the auto complete window pops up, and the user can select from a list of possible commands (or keep typing to narrow it down further). With 0.6.2 this works great:

Image
0.6.2

With 0.7.1, it appears that the auto complete window is being clipped by something (the rect of the FrameWindow?):

Image
0.7.1

It's all on a DefaultWindow, so I wouldn't have imagined the clip to happen. I have tried adding ClippedByParent to the FrameWindow, but it resulted in the same. Here's my layout:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
    <Window Type="TaharezLook/FrameWindow" Name="Zonsole" >
        <Property Name="Text" Value="Zonsole" />
        <Property Name="TitlebarFont" Value="Consola" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="TitlebarEnabled" Value="True" />
        <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.02,0},{0.98,0},{0.5,0}}" />
        <Window Type="TaharezLook/Listbox" Name="Zonsole/Buffer" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0,10},{0,25},{1,-12},{1,-33}}" />
        </Window>
        <Window Type="TaharezLook/Editbox" Name="Zonsole/Input" >
            <Property Name="MaxTextLength" Value="1073741823" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0,10},{1,-27},{1,-12},{1,-5}}" />
            <Window Type="TaharezLook/Listbox" Name="Zonsole/Input/AutoComplete" >
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="ClippedByParent" Value="False" />
                <Property Name="UnifiedAreaRect" Value="{{0.00143799,0},{1.05544,0},{0.251438,0},{5.99056,0}}" />
            </Window>
        </Window>
    </Window>
</GUILayout>


On an unrelated note, I set the Alpha property of the console to 0.7 in the code. It appears to be much more transparent in 0.7.1 (as apparent from the screenshots above). Did something change with this recently?

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

Re: 0.7.1 clipping issue

Postby CrazyEddie » Fri May 14, 2010 08:49

The clipping issue is caused because the FrameWindow will be using a texture to cache the rendered content of the FrameWindow and all it's child windows. This leads to an issue with children not clipped to the FrameWindow area, because the texture is only large enough for the FrameWindow. There are a couple of options, the first is to disable the texture caching for windows affected by this, you can do this by setting the AutoRenderingSurface property to "False" for the FrameWindow in the layout. The other alternative is to not have the AutoComplete window as a child of the FrameWindow, though this potentially makes window management more complex for you.

The alpha issue is known, and has already been fixed for most renderers (grab a snapshot release or use svn branch v0-7 to get these fixes). The only place this issue still exists is in the Irrlicht renderer where it's not currently easily fixed, and (I believe) in the WGL pbuffer based texture target implementation - which will be fixed this weekend. You should find however, that if you disable the AutoRenderingSurface as described above, this issue will also disappear ;)

CE.

reacher
Just popping in
Just popping in
Posts: 8
Joined: Thu Apr 02, 2009 14:29

Re: 0.7.1 clipping issue

Postby reacher » Fri May 14, 2010 14:27

Adding that property fixed the clipping issue. But now the client portion of the frame window is riding on top of everything else.

Image

Also the cursor is apparently moving behind the window (although this was happening before I added the property)

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

Re: 0.7.1 clipping issue

Postby CrazyEddie » Sat May 15, 2010 15:49

Is this the OpenGL renderer? It's probably a state issue, did you enable the 'extra state settings' via CEGUI::OpenGLRenderer::enableExtraStateSettings? If not, that will likely fix this other issue :)

CE.

wang37921
Just popping in
Just popping in
Posts: 20
Joined: Thu Dec 24, 2009 11:22
Contact:

Re: 0.7.1 clipping issue

Postby wang37921 » Sat Jun 19, 2010 09:24

:rofl: mark~

User avatar
ErikHjortsberg
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Sun Jan 23, 2005 12:45
Location: Sweden
Contact:

Re: 0.7.1 clipping issue

Postby ErikHjortsberg » Thu Jul 01, 2010 20:52

This seems to be an universal issue with using ClippedByParent=false and having AutoRenderingSurface=true in a parent window. Since most people will be using FrameWindows as their main top level window type I think one will see more of this issue.
Would it make sense to make it so that if a window is having AutoRenderingSurface=true, and has a child which has ClippedByParent=false, then if that child extends beyond the parent for one render call this will be handled automatically?
I'm not that versed in how the AutoRenderingSurface feature works, but would one solution be to disable that for those specific render calls when when the aforementioned situation occurs? Or would it be more efficient just to extend the render geometry to also encompass the area of the child in that render call?
Or would a more optimal solution be to use a different render geometry for the child window and stitch the two together?
Ember, a client for the Worldforge system.

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

Re: 0.7.1 clipping issue

Postby CrazyEddie » Fri Jul 02, 2010 08:51

Yeah, I think I'll have to try and come up with something! With AutoRenderingSurface enabled, the window is texture backed, and all rendering for that window (and attached child content) is done to that texture. The issue is that the texture is the size of the parent window, so when parent clipping is off and a child should fall outside the parent, it's rendering is still clipped to the edge of the texture.

The solutions available are either to make the texture larger, which wastes video resources, or to do something whereby appropriate children get rendered some other way - though the issue is then that if the parent is using some render effect, or is rotated, the 'unclipped' child content, since it's not rendered back to the parents texture will be unaffected by such effects / settings. So given those choices, I think larger texture is the only acceptable solution.

CE.

LuckyCarbon
Just popping in
Just popping in
Posts: 2
Joined: Thu Aug 19, 2010 20:09
Location: USA
Contact:

Re: 0.7.1 clipping issue

Postby LuckyCarbon » Thu Aug 19, 2010 20:20

Ah thank you!

I was having similar problems using Ogre 1.71 & CEGUI 0.7.1 with OpenGL, very odd behavior. I was trying to adapt the Drag & Drop Sample to Ogre's Tutorial 7 code, as soon as I'd start dragging the DragContainer would disappear. Moving the cursor all the way to the left of the screen would make it start to appear again. I also had non-moving StaticImages hidden.

Setting
<Property Name="ClippedByParent" Value="False" />
<Property Name="AutoRenderingSurface" Value="False" />
directly on the StaticImages under the DragContainer fixed my problem.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests