Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73c180d

Browse files
committed
Fix the terrain not setting fully the rasterizer state.
1 parent 6b37025 commit 73c180d

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Source/ORTS.Common/ConsistGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ConsistGenerator
4444
const string EngineTemplate = @"Wagon ( ""enginname""
4545
Type ( Engine )
4646
WagonShape ( ""shapefilename"" )
47-
Size (100m 100m 100m )
47+
Size (100m 7m 100m )
4848
)
4949
Engine ( ""enginname""
5050
Wagon ( ""enginname"" )

Source/RunActivity/Viewer3D/GltfShape.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,15 +1782,15 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
17821782
/// </summary>
17831783
static readonly Dictionary<string, Matrix> SampleModelsAdjustments = new Dictionary<string, Matrix>
17841784
{
1785-
{ "2CylinderEngine".ToLower(), Matrix.CreateScale(0.01f) * Matrix.CreateTranslation(0, 2, 0) },
1785+
{ "2CylinderEngine".ToLower(), Matrix.CreateScale(0.005f) * Matrix.CreateTranslation(0, 2, 0) },
17861786
{ "ABeautifulGame".ToLower(), Matrix.CreateScale(10) },
17871787
{ "AnimatedCube".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
17881788
{ "AnimatedMorphCube".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
17891789
{ "AnimatedMorphSphere".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
17901790
{ "AnimatedTriangle".ToLower(), Matrix.CreateTranslation(0, 1, 0) },
17911791
{ "AntiqueCamera".ToLower(), Matrix.CreateScale(0.5f) },
17921792
{ "AttenuationTest".ToLower(), Matrix.CreateScale(0.3f) * Matrix.CreateTranslation(0, 4, 0) },
1793-
{ "Avocado".ToLower(), Matrix.CreateScale(50) },
1793+
{ "Avocado".ToLower(), Matrix.CreateScale(30) },
17941794
{ "BarramundiFish".ToLower(), Matrix.CreateScale(10) },
17951795
{ "BoomBox".ToLower(), Matrix.CreateScale(100) * Matrix.CreateTranslation(0, 2, 0) },
17961796
{ "BoomBoxWithAxes".ToLower(), Matrix.CreateScale(100) * Matrix.CreateTranslation(0, 2, 0) },
@@ -1803,11 +1803,12 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
18031803
{ "BoxVertexColors".ToLower(), Matrix.CreateTranslation(0, 1, 0) },
18041804
{ "Buggy".ToLower(), Matrix.CreateScale(0.02f) * Matrix.CreateTranslation(0, 1, 0) },
18051805
{ "ClearCoatTest".ToLower(), Matrix.CreateScale(0.5f) * Matrix.CreateTranslation(0, 3, 0) },
1806-
{ "Corset".ToLower(), Matrix.CreateScale(40) * Matrix.CreateTranslation(0, 1, 0) },
1806+
{ "Corset".ToLower(), Matrix.CreateScale(30) * Matrix.CreateTranslation(0, 1, 0) },
18071807
{ "Cube".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
18081808
{ "DamagedHelmet".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
18091809
{ "DragonAttenuation".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
18101810
{ "EmissiveStrengthTest".ToLower(), Matrix.CreateScale(0.5f) * Matrix.CreateTranslation(0, 3, 0) },
1811+
{ "EnvironmentTest".ToLower(), Matrix.CreateScale(0.5f) },
18111812
{ "FlightHelmet".ToLower(), Matrix.CreateScale(5) },
18121813
{ "Fox".ToLower(), Matrix.CreateScale(0.02f) },
18131814
{ "GearboxAssy".ToLower(), Matrix.CreateScale(0.5f) * Matrix.CreateTranslation(80, -5, 0) },
@@ -1821,14 +1822,14 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
18211822
{ "Lantern".ToLower(), Matrix.CreateScale(0.2f) },
18221823
{ "MaterialsVariantsShoe".ToLower(), Matrix.CreateScale(5) },
18231824
{ "MetalRoughSpheres".ToLower(), Matrix.CreateTranslation(0, 5, 0) },
1824-
{ "MetalRoughSpheresNoTextures".ToLower(), Matrix.CreateTranslation(0, 5, 0) },
1825+
{ "MetalRoughSpheresNoTextures".ToLower(), Matrix.CreateScale(800) * Matrix.CreateTranslation(0, 1, 0) },
18251826
{ "MorphPrimitivesTest".ToLower(), Matrix.CreateScale(2) * Matrix.CreateTranslation(0, 1, 0) },
18261827
{ "MosquitoInAmber".ToLower(), Matrix.CreateScale(25) * Matrix.CreateTranslation(0, 1, 0) },
18271828
{ "MultiUVTest".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
18281829
{ "NormalTangentMirrorTest".ToLower(), Matrix.CreateScale(2) * Matrix.CreateTranslation(0, 2, 0) },
18291830
{ "NormalTangentTest".ToLower(), Matrix.CreateScale(2) * Matrix.CreateTranslation(0, 2, 0) },
18301831
{ "OrientationTest".ToLower(), Matrix.CreateScale(0.2f) * Matrix.CreateTranslation(0, 2, 0) },
1831-
{ "ReciprocatingSaw".ToLower(), Matrix.CreateScale(0.02f) * Matrix.CreateTranslation(0, 3, 0) },
1832+
{ "ReciprocatingSaw".ToLower(), Matrix.CreateScale(0.01f) * Matrix.CreateTranslation(0, 3, 0) },
18321833
{ "RecursiveSkeletons".ToLower(), Matrix.CreateScale(0.05f) },
18331834
{ "RiggedSimple".ToLower(), Matrix.CreateTranslation(0, 5, 0) },
18341835
{ "SciFiHelmet".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
@@ -1844,7 +1845,7 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
18441845
{ "TextureSettingsTest".ToLower(), Matrix.CreateScale(0.5f) * Matrix.CreateTranslation(0, 4, 0) },
18451846
{ "TextureTransformMultiTest".ToLower(), Matrix.CreateScale(2) * Matrix.CreateTranslation(0, 4, 0) },
18461847
{ "TextureTransformTest".ToLower(), Matrix.CreateTranslation(0, 2, 0) },
1847-
{ "ToyCar".ToLower(), Matrix.CreateScale(80) * Matrix.CreateTranslation(0, 2, 0)},
1848+
{ "ToyCar".ToLower(), Matrix.CreateScale(100) * Matrix.CreateTranslation(0, 2, 0)},
18481849
{ "TransmissionRoughnessTest".ToLower(), Matrix.CreateScale(5) * Matrix.CreateTranslation(0, 3, 0) },
18491850
{ "TransmissionTest".ToLower(), Matrix.CreateScale(3) * Matrix.CreateTranslation(0, 2, 0) },
18501851
{ "TwoSidedPlane".ToLower(), Matrix.CreateTranslation(0, 1, 0) },

Source/RunActivity/Viewer3D/Terrain.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ public override void SetState(GraphicsDevice graphicsDevice, Material previousMa
524524
shader.OverlayScale = OverlayScale;
525525

526526
graphicsDevice.BlendState = BlendState.NonPremultiplied;
527+
graphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
527528
}
528529

529530
public override void Render(GraphicsDevice graphicsDevice, IEnumerable<RenderItem> renderItems, ref Matrix XNAViewMatrix, ref Matrix XNAProjectionMatrix)

0 commit comments

Comments
 (0)