none
double buffering and vsync?

    Question

  • Do silverlight support double buffering and vsync?

     I am a beginner to silverlight, I tried to make a little ticker animation which translate textblock from left to right with silverlight. The performance is not very good at all. I think the problem is related to double buffering and vsync.

     

    Thanks.
     

    Wednesday, July 18, 2007 6:33 AM

All replies

  • Yes, we do double buffer.  Whether you get vtrace tearing depends on the OS you are running on.  

    What browser and platform are you running on?  Something as simple as translating a textblock should run at very high framerates.

    Some gotcha's to watch out for:

    1. set windowless=false on the control (fastest mode and less tearing)
    2. make sure the background is not transparent

    - Ashraf Michail
     

    Thursday, July 19, 2007 1:13 AM
  •  Even the control is set windowless: 'false', the textblock does not move smoothly. I wonder how can I create a smooth ticker

     

    The textblock I have made is

    <TextBlock x:Name="text" Canvas.Top="0" Canvas.Left="0" Width="450" Height="100" FontSize="72" Text="TextBlock" TextWrapping="Wrap">
            <TextBlock.RenderTransform>
                <TranslateTransform x:Name="AnimatedRotateTransform" X="0" Y="0"/>
            </TextBlock.RenderTransform>
           
            <TextBlock.Triggers>

            <!-- Animates the rectangle's opacity. -->
            <EventTrigger RoutedEvent="TextBlock.Loaded">
              <BeginStoryboard>
                <Storyboard>
                  <DoubleAnimation
                    Storyboard.TargetName="AnimatedRotateTransform"
                    Storyboard.TargetProperty="X"
                    From="1024" To="-450" Duration="0:0:5"
                    AutoReverse="False" RepeatBehavior="Forever" />
                </Storyboard>
              </BeginStoryboard>
            </EventTrigger>
          </TextBlock.Triggers>
        </TextBlock>

     Thanks

    Thursday, July 19, 2007 2:30 AM
  • I take it you've already tried increasing the framerate?

    Thursday, July 19, 2007 12:31 PM
  • I have tried 24 and even 36, the textblock still does not move smoothly

    Thursday, July 19, 2007 9:26 PM
  • There's no reason I'm aware of that you can't go higher than that.  I tried it at 200 and it looked pretty nice.

    Friday, July 20, 2007 12:09 PM
  •  I have tried to enable frame rate counter and it shows that the demo is now running at around 100 fps. Tearing is still there.

    Monday, July 23, 2007 3:47 AM
  • Tearing will be present on XP but shouldn't be present on Vista or MacOS if you set windowless=false.

     

    Monday, July 23, 2007 10:38 AM
  • Is there any workaround in winXP?

    If there is no, is there any plan that the feature will be supported in future release of silverlight?

     

     Thanks

    Monday, July 23, 2007 9:54 PM
  • This thread seems to have stalled with no resolution.

    Vsync seems to be an ongoing issue for a number of people using Silverlight.  The issue is not limited to the poster above - Netflix for instance has page tearing issues now that it uses Silverlight.

     How can developers and users prevent page tearing?

     

    Monday, September 28, 2009 8:56 PM
  • Is there a flag somewhere that indicates when a refresh is in progress? I know that seems unlikely since the plugin doesn't have that much access to the GPU, but it might help us prevent shearing when implementing procedural animation.
    Wednesday, May 05, 2010 10:44 PM