WP7 Silverlight High Fill Rate but Fantastic FPS????

Topics: User Forum
Feb 15, 2011 at 6:55 AM

Im panning the graphics on the screen with gestures and have two parralax layers.  I'm also zoomed in with the camera controller.  The fill rate is over 5 and can go as high as 11 in some tests.  Whats strange is there is little impact on both FPS counters (both are still at 45).  MS says that fill rate shouldnt go above 2.5 and it goes red at 3.5.  The surface counter is low, texture memory usage is low and texture count is 1.  I have about 15 shapes on the screen all set to bitmap cache (parallax images are also bitmap cache), the parallax layers have their own graphics and there is 1 for the physics objects.  The caching is responsible for the fill rate, but, whats responsible for keeping FPS so good with such a high fill rate?

Im worried because my prototype is almost done, but, I don't want to put all my time into the actual game only to find out 5 months down the road a new phone comes out and for some reason flips out over the high fill rate.  I'm also zooming in/out.  Also, overall memory counter/use is only 14MB.  All the way zoomed out (800x480 landscape) and fill rate is low (2)...this is the dimensions the game is built in (Expression Blend) and zoomed in about 300 percent and the fill rate is 5 or so, both still run perfectly when panning the camera with gestures with zero lag.

Any thoughts/experience with Silverlight WP7 Fill Rate and Farseer is appreciated.

Coordinator
Feb 15, 2011 at 11:49 AM

Are you on a real device or in the emulator?  I'm very surprised if you are getting a good framerate with a 5+ fillrate on a real device.  If in emulator, then all bets are off as it's not an accurate representation of a real device.

-Jeff

Feb 15, 2011 at 3:48 PM

Samsung Focus, not the emulator.  Emulator actually doesn't perform as well as the device in this example (only slightly).  Honestly, Im confused with this perf.

Feb 15, 2011 at 5:32 PM

FYI - heres the numbers for the counters on the screen (in addition the last number is RAM used from some bit of code I found) while free dragging very quickly.  Below is the xaml as well, smooth as butter zoomed in at 200% with gestures doing the panning.  Parallax layers work great.

055
055
004768
031
001
05.4  (high fill rate.....)
12MB Memory 

 

 

    <Canvas x:Name="LayoutRoot" Width="800" Height="480" Margin="0">           
        <TextBlock FontSize="21.333" x:Name="Cords" Style="{StaticResource PhoneTextTitle1Style}" Text="Canvas Cords = " Canvas.Left="8" Margin="0" Canvas.Top="297" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="21.333" x:Name="CordsCannon" Style="{StaticResource PhoneTextTitle1Style}" Text="Cannon Cords = " Canvas.Left="8" Margin="0" Canvas.Top="272" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="21.333" x:Name="Distance" Style="{StaticResource PhoneTextTitle1Style}" Text="Distance = " Canvas.Left="8" Margin="0" Canvas.Top="326" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="21.333" x:Name="Velocity" Style="{StaticResource PhoneTextTitle1Style}" Text="Velocity = " Canvas.Left="8" Margin="0" Canvas.Top="355" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="21.333" x:Name="Rotation" Style="{StaticResource PhoneTextTitle1Style}" Text="Rotation = " Canvas.Left="8" Margin="0" Canvas.Top="378" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="21.333" x:Name="Gesture" Style="{StaticResource PhoneTextTitle1Style}" Text="Gesture = " Canvas.Left="8" Margin="0" Canvas.Top="400" Foreground="#FF131413" Visibility="Collapsed" />
        <TextBlock FontSize="18.667" x:Name="PinchDist" Style="{StaticResource PhoneTextTitle1Style}" Text="Pinch Dist = " Canvas.Left="8" Margin="0" Canvas.Top="421" Foreground="#FF131413" Visibility="Collapsed" />

        <Canvas x:Name="canPhy" Height="480" Width="800">          
            <Custom:Interaction.Behaviors>
                <pb:PhysicsControllerBehavior TimeStep="0.025" Iterations="10" GravityVertical="10"/>
            </Custom:Interaction.Behaviors>
            <Canvas x:Name="pLax3" Width="800" Height="430">
                    <Canvas.Clip>
                        <RectangleGeometry Rect="0 0 800 480" />
                    </Canvas.Clip>
                <Image Height="430" x:Name="imgPlax3" Source="images/foreground.jpg" Stretch="Fill" Width="800">
					<Image.CacheMode>
					<BitmapCache RenderAtScale="2" />
					</Image.CacheMode>                    	            
				</Image>
            </Canvas>
            <Canvas x:Name="pLax2" Canvas.Top="366" Width="800" Height="64">
                <Canvas.Clip>
                    <RectangleGeometry Rect="0 0 800 480" />
                </Canvas.Clip>
                <Image Height="64" x:Name="imgPlax2" Source="images/layer3.png" Stretch="Fill" Width="346" Canvas.Left="64">
					<Image.CacheMode>
					<BitmapCache RenderAtScale="2" />
					</Image.CacheMode>                	            
				</Image>
        	</Canvas>

            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior IsStatic="True"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="100">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="200">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="300">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="400">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="500">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="600">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Height="50" Stroke="Black" Width="100" Canvas.Top="430" StrokeThickness="0" CacheMode="BitmapCache" Canvas.Left="700">
            	<Rectangle.Fill>
            		<ImageBrush Stretch="None" ImageSource="images/ground.jpg"/>
            	</Rectangle.Fill>
            	<Custom:Interaction.Behaviors>
            		<pb:PhysicsObjectBehavior IsStatic="True"/>
            	</Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect1" Fill="#FF0D1BF3" Height="20" Canvas.Left="552" Stroke="Black" Canvas.Top="404" Width="16" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect2" Fill="#FF0D1BF3" Height="20" Canvas.Left="452" Stroke="Black" Canvas.Top="360" Width="16" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect3" Fill="#FF0D1BF3" Height="22" Stroke="Black" Width="16" Canvas.Left="424" Canvas.Top="410" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" StrokeThickness="0" CacheMode="BitmapCache">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect4" Fill="#FF0D1BF3" Height="16" Stroke="Black" Width="16" Canvas.Left="512" Canvas.Top="408" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" StrokeThickness="0" CacheMode="BitmapCache">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect5" Fill="#FF29F30D" Height="28" Canvas.Left="576" Stroke="Black" Canvas.Top="272" Width="16" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect1_Copy" Fill="#FFF34D0D" Height="116" Canvas.Left="528" Stroke="Black" Canvas.Top="314.25" Width="16" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect4_Copy" Fill="#FFF34D0D" Height="60" Canvas.Left="576" Stroke="Black" Canvas.Top="277.875" Width="16" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="6" Stroke="Black" Width="188" Canvas.Left="452" Canvas.Top="424" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior IsStatic="True"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="rect5_Copy" Height="60" Canvas.Left="480" Stroke="Black" Canvas.Top="277.875" Width="16" RenderTransformOrigin="0.5,0.5" Fill="#FFF34D0D" StrokeThickness="0" CacheMode="BitmapCache" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="rectangle"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="12" Stroke="Black" Width="48" Canvas.Left="562" Canvas.Top="334" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="44" Stroke="Black" Width="56" Canvas.Left="584" Canvas.Top="380" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="44" Stroke="Black" Width="44" Canvas.Left="452" Canvas.Top="380" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="12" Stroke="Black" Width="48" Canvas.Left="462" Canvas.Top="334" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Rectangle.RenderTransform>
                    <CompositeTransform Rotation="90"/>
                </Rectangle.RenderTransform>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle Fill="#FFF34D0D" Height="102" Stroke="Black" Width="32" Canvas.Left="640" Canvas.Top="328" RenderTransformOrigin="0.5,0.5" StrokeThickness="0" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior IsStatic="True"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="CannonBase" Fill="#FF3CE20F" Height="9" Canvas.Left="45" Stroke="Black" Canvas.Top="421" Width="21" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior IsStatic="True" CollisionGroup="2"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Rectangle x:Name="CannonTube" Height="36" Canvas.Left="43" Stroke="Black" Canvas.Top="386" Width="25" StrokeThickness="0">
					<Rectangle.CacheMode>
					<BitmapCache RenderAtScale="2" />
					</Rectangle.CacheMode>              	
                <Rectangle.Fill>
                    <ImageBrush Stretch="Fill" ImageSource="images/CannonImage.png"/>
                </Rectangle.Fill>
                <Custom:Interaction.Triggers>
                	<Custom:EventTrigger EventName="ManipulationDelta" SourceName="touchRect">
                		<pb:PhysicsApplyRotationBehavior/>
                	</Custom:EventTrigger>
                </Custom:Interaction.Triggers>
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior CollisionGroup="2" IsStatic="True"/>
                </Custom:Interaction.Behaviors>
            </Rectangle>
            <Ellipse x:Name="CannonJoint" Fill="#FF0FE2D4" Height="5" Canvas.Left="53" Stroke="Black" Canvas.Top="419" Width="5" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsJointBehavior BodyOne="CannonTube" BodyTwo="CannonBase"/>
                </Custom:Interaction.Behaviors>
            </Ellipse>
            <Ellipse x:Name="CannonAxel" Fill="#02DCB018" Height="5" Canvas.Left="53" Canvas.Top="419" Width="5" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior CollisionGroup="2" IsStatic="True"/>
                </Custom:Interaction.Behaviors>
            </Ellipse>
            <Ellipse x:Name="CannonAxellJoint" Fill="#FFDCD518" Height="3" Canvas.Left="54" Canvas.Top="420" Width="3" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsJointBehavior BodyOne="CannonTube" BodyTwo="CannonAxel"/>
                </Custom:Interaction.Behaviors>
            </Ellipse>
            <Canvas x:Name="catOutter" Height="15" Width="15" Canvas.Left="48" Canvas.Top="407" CacheMode="BitmapCache">
                <Custom:Interaction.Behaviors>
                	<pb:PhysicsObjectBehavior BoundaryElement="catBody" Mass="0.3" CollisionGroup="2"/>
                </Custom:Interaction.Behaviors>
                <Ellipse x:Name="catBody" Fill="#FF0F0FDC" Height="15" Stroke="Black" Width="15" StrokeThickness="0"/>
                <Ellipse x:Name="leftEar" Fill="#FF8D8DE7" Height="4" Stroke="Black" Width="4" StrokeThickness="0"/>
                <Ellipse x:Name="rigtEar" Fill="#FF8D8DE7" Height="4" Stroke="Black" Width="4" Canvas.Left="11" StrokeThickness="0"/>
                <Ellipse x:Name="eye" Fill="#FF4EDC0F" Height="4" Canvas.Left="6" Stroke="Black" Canvas.Top="4" Width="4" RenderTransformOrigin="0.5,0.5" Loaded="eye_Loaded" StrokeThickness="0">
                    <Ellipse.RenderTransform>
                        <CompositeTransform/>
                    </Ellipse.RenderTransform>
                </Ellipse>
            </Canvas>
        </Canvas>
        <Canvas x:Name="touchRect" Background="#03000000" Width="800" Height="480" ManipulationCompleted="touchRect_ManipulationCompleted" ManipulationDelta="touchRect_ManipulationDelta"/>
        <Rectangle x:Name="rectHitDector" Fill="#FFF3220D" Height="100" Stroke="Black" Width="100" Canvas.Left="620" Canvas.Top="24" Visibility="Collapsed"/>
    </Canvas>