Пример #1
0
        public override void Initialize(ContentManager contentLoader, ComponentManifest manifest)
        {
            TerrainAsset = contentLoader.Load<Terrain>((string)(manifest.Properties[ManifestKeys.TERRAIN]));
            Heights = TerrainAsset.GetGeometry();

            EffectRegistry.Add(TerrainAsset.Effect, (RenderOptions)(TerrainAsset.Tag));

            mDefaultMaterial = new EffectApplication(TerrainAsset.Effect, RenderStatePresets.Default);
            mDefaultMaterial.AddParamSetter(new CommonParamSetter());
            mDefaultMaterial.AddParamSetter(new ShadowParamSetter());
            mDefaultMaterial.AddParamSetter(new HDRLightParamSetter());
            mDefaultMaterial.AddParamSetter(new FogParamSetter());
            mDepthOnlyMaterial = new EffectApplication(EffectRegistry.DepthOnlyFx, RenderStatePresets.Default);
            mDepthOnlyMaterial.AddParamSetter(new WorldViewProjParamSetter());

            base.Initialize(contentLoader, manifest);
        }
Пример #2
0
 public TerrainGeometryNode(Terrain geometry, int vertexOffset, EffectApplication defaultMaterial)
     : base(defaultMaterial)
 {
     Geometry = geometry;
     VertexOffset = vertexOffset;
 }