nokola
Posts: 117
Joined: 10 Mar 2015, 05:29

Re: Rendering errors for nested objects

17 Nov 2017, 18:18

Thanks jsantos! Added http://www.noesisengine.com/bugs/view.php?id=1195

It would be interesting to understand why the issue happens with half floats. In my screenshot above, I'd expect even if there are precision errors the color to be gray, since both the top and bottom texture have large enough gray around the edges (~5 pixels minimum)
 
User avatar
jsantos
Site Admin
Posts: 1872
Joined: 20 Jan 2012, 17:18
Contact:

Re: Rendering errors for nested objects

20 Nov 2017, 12:40

Not sure your case is also related to using half-floats. I will send you a patched version for verification purposes.
 
nokola
Posts: 117
Joined: 10 Mar 2015, 05:29

Re: Rendering errors for nested objects

21 Nov 2017, 04:09

I noticed the "ghost" lines happen for me when I set Opacity of element to < 1, e.g. when this button transitions to disabled state:
    <Style x:Key="ButtonCircle" TargetType="Button">
        <Setter Property="Width" Value="50"/>
        <Setter Property="MinHeight" Value="50"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent" x:Name="body">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="border">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0.7"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer">
                                            <DiscreteDoubleKeyFrame KeyTime="0" Value="0.3"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}">
                            <ContentControl x:Name="ContentContainer" Content="{TemplateBinding Content}" VerticalAlignment="Top" Margin="9,9,9,0" />
                            <Ellipse x:Name="border" Opacity="0" IsHitTestVisible="False" Height="35" Width="35" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="7.5">
                                <!--Fill="#99FFFFFF"-->
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#99FFFFFF" Offset="0"/>
                                        <GradientStop Color="#99FFFFFF" Offset="0.94"/>
                                        <GradientStop Offset="1"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
Here's the comparison with Opacity 1 and 0.3:
GhostLineOpacity.png
GhostLineOpacity.png (7.46 KiB) Viewed 144 times
 
nokola
Posts: 117
Joined: 10 Mar 2015, 05:29

Re: Rendering errors for nested objects

21 Nov 2017, 04:19

Just noticed that the ghost lines seem to change based on what UI is elsewhere on the screen. Perhaps the UI is rendered too close in an off-screen texture atlas and "leaks" into adjacent UI? A 1 or 2-pixel transparent border around UI would fix it in such case. Just a guess.

Here' s a screenshot of ghost lines being changed from changing some completely unrelated part of the UI:
GhostLinesChangeWithUI.png
GhostLinesChangeWithUI.png (9.77 KiB) Viewed 144 times
 
nokola
Posts: 117
Joined: 10 Mar 2015, 05:29

Re: Rendering errors for nested objects

21 Nov 2017, 17:30

Confirmed that if I change from having Opacity < 1 to Opacity == 1 and a half-transparent brush instead, the artifacts disappear. Note: can't use in all cases, sometimes I want the opacity to apply (e.g. for dimming out images / full button face)
 
User avatar
jsantos
Site Admin
Posts: 1872
Joined: 20 Jan 2012, 17:18
Contact:

Re: Rendering errors for nested objects

21 Nov 2017, 21:39

It makes sense, because we only use offscreen rendertarget when Opacity < 1. And this bug happens when rendering to offscreen textures, when we are compositing those textures, the rectangles we use to blit are getting incorrect pixels for the borders.
 
nokola
Posts: 117
Joined: 10 Mar 2015, 05:29

Re: Rendering errors for nested objects

23 Nov 2017, 19:46

I got the test version with non-half floats - works! No more rendering artifacts here! :)
I suspect textures nearby were "leaking" in the opacity rendertexture that Noesis uses internally with half floats.
 
User avatar
jsantos
Site Admin
Posts: 1872
Joined: 20 Jan 2012, 17:18
Contact:

Re: Rendering errors for nested objects

27 Nov 2017, 22:15

Thanks a lot for the feedback! We are working on the fix

Who is online

Users browsing this forum: No registered users and 3 guests