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); }
public TerrainGeometryNode(Terrain geometry, int vertexOffset, EffectApplication defaultMaterial) : base(defaultMaterial) { Geometry = geometry; VertexOffset = vertexOffset; }