Skybox issue
#1
Hi i wonder if anyone can help me get rid of seams in my skybox, and also the top seems to render darker than the rest ! can anyone help me please

[Image: https://www.graphix.org.uk/downloads/sbtest.jpg]
Kevan Hampson
#2
If the top side is darker, this means that the skybox is not illuminated only by an ambient light but also by some other light source.

Please check the source code from the DXEngine samples PhysicallyBasedRendering/PBRPropertiesSample.xaml:
Code:
<!-- The trick to create a skybox in WPF is to use two Viewport3D objects:
     The first Viewport3D holds the MultiMaterialBoxVisual3D that shows the skybox.
     This Viewbox is special because it defines an AmbientLight with White color. This removes all effects of the light directions and prevents shading the box planes.
     Another specialty of this Viewbox is that its camera is synchronized with the main Viewport3D. But it synchronize only heading and direction and not position changes.
     This way the camera cannot go outside the skybox's MultiMaterialBoxVisual3D.
-->
<Viewport3D Name="SkyboxViewport" Grid.Column="0" Visibility="Collapsed">
    <visuals:MultiMaterialBoxVisual3D CenterPosition="0 0 0" Size="500 500 500"
                                      IsTwoSidedMaterial="True"
                                      TopMaterial="Resources/SkyboxTextures/CloudyLightRaysUp512.png"
                                      LeftMaterial="Resources/SkyboxTextures/CloudyLightRaysLeft512.png"
                                      BackMaterial="Resources/SkyboxTextures/CloudyLightRaysBack512.png"
                                      RightMaterial="Resources/SkyboxTextures/CloudyLightRaysRight512.png"
                                      FrontMaterial="Resources/SkyboxTextures/CloudyLightRaysFront512.png"
                                      BottomMaterial="Resources/SkyboxTextures/CloudyLightRaysDown512.png" />

    <ModelVisual3D>
        <ModelVisual3D.Content>
            <Model3DGroup>
                <AmbientLight Color="White"/>
            </Model3DGroup>
        </ModelVisual3D.Content>
    </ModelVisual3D>
</Viewport3D>

As seen here, a separate Viewport3D is used to render the skybox in the background.


I do not know what causes the edges of the images to be visible. Maybe the images have a semi-transparent pixel at the border. 

You can try to use your images in the sample mentioned above and see how they look (or use the images from that sample in your app).
Andrej Benedik
#3
thank you that resolved it :)
Kevan Hampson
  


Forum Jump:


Users browsing this thread:
1 Guest(s)