SkyBox dont work in non square viewports.

Oct 17, 2010 at 12:34 PM

Hi again adept,

I've tried skybox but i get unxpected behavior, some faces are not drawn correctly leaving large areas of black..

My game its defined like this:

            <Execution:Game x:Name="_game" Width="1000" Height="1000" Background="Black"   Canvas.Top="-10"  >
                <Execution:Game.Camera >
                    <View:Camera Position="0,0,-200" Target="0,0,0"/>
                </Execution:Game.Camera>
                <Execution:Game.Skybox>
               <Objects:Skybox IsEnabled="true"
                     Front="/Portfolio;component/Images/sky.png"
                     Back="/Portfolio;component/Images/sky.png"
                     Top="/Portfolio;component/Images/sky.png"
                     Bottom="/Portfolio;component/Images/sky.png"
                     Left="/Portfolio;component/Images/sky.png"
                     Right="/Portfolio;component/Images/sky.png"
                >
                   </Objects:Skybox>
                </Execution:Game.Skybox>
                <Lighting:OmniLight x:Name="_omni" Position="-100,700,-400" Ambient="White" Diffuse="White" Specular="White"/>
                <Geometries:Mesh x:Name="mshPyrUp"   Scale="0.001,0,0.001" Position="-200,-20,00"  Rotation="0,0,0"  Material="{StaticResource logoMaterial3}" AssetName="Portfolio;component//Assets/pirup.ase" IsVisible="False" />
                <Geometries:Mesh x:Name="mshPyrDown" Scale="0.001,0,0.001" Position="-200,-20,0" Rotation="0,0,0"  Material="{StaticResource logoMaterial3}" AssetName="Portfolio;component//Assets/pirdown.ase" IsVisible="False"/>
                <Geometries:Mesh x:Name="mshSphere" Scale="0.001,0,0.001"   Position="-240,-20,50" Rotation="60,0,0"  Material="{StaticResource earthMaterial}" AssetName="Portfolio;component//Assets/sphere.ase" IsVisible="True"/>

                <Geometries:Box  x:Name="mshEvolve1" Dimension="400,200,64"  Position="150,-10,20" Rotation="00,90,0"  IsVisible="True"/>

                <!--<Geometries:Box  x:Name="mshMorph"  Dimension="75,100,80" Scale="0.001,0.001,0.001"   Position="-280,-20,90" Rotation="0,0,0"  Material="{StaticResource morphMaterial}"  IsVisible="True"/>-->

                <Geometries:Mesh x:Name="mshMorph"   Scale="0.001,0.001,0.001"  Position="-200,-10,0" Rotation="0,90,0"  Material="{StaticResource morphMaterial}" AssetName="Portfolio;component//Assets/morph.ase" IsVisible="True"/>
               
                <Geometries:Mesh x:Name="mshRing1" Scale="0.001,0,0.001" Position="-230,-20,20" Rotation="0,0,0"    Material="{StaticResource ringMaterial}" AssetName="Portfolio;component//Assets/ring.ase" IsVisible="True" />
                <Geometries:Mesh x:Name="mshRing2" Scale="0.001,0,0.001"  Position="-230,-20,20" Rotation="0,90,0"    Material="{StaticResource ringMaterial}" AssetName="Portfolio;component//Assets/ring.ase" IsVisible="True"/>
                <Geometries:Mesh x:Name="mshRing3" Scale="0.001,0,0.001"  Position="-230,-20,20" Rotation="0,45,0"   Material="{StaticResource ringMaterial}" AssetName="Portfolio;component/Assets/ring.ase" IsVisible="True"/>
                <Geometries:Mesh x:Name="mshRing4" Scale="0.001,0,0.001"  Position="-230,-20,20" Rotation="0,135,0"   Material="{StaticResource ringMaterial}" AssetName="Portfolio;component/Assets/ring.ase" IsVisible="True"/>


            </Execution:Game>

 

and this is what i get...

error1"

and also this...

 

error2"

 

Weird, even my game is 1000 x 1000 in XAML, in runtime i change it to 600 x 200...

Thanks..

Coordinator
Oct 17, 2010 at 2:15 PM

This is a known bug (http://balder.codeplex.com/workitem/13624).

It seems that the texture for the skybox must be smaller than that of the viewport to work. Kinda strange.