internal static void Init() { DynamicGeometryRenderer = new MyGeometryRenderer(MyScene.DynamicRenderablesDBVH, DynamicShadows); if (MyScene.SeparateGeometry) StaticGeometryRenderer = new MyGeometryRenderer(MyScene.StaticRenderablesDBVH, StaticShadows); m_foliageGenerator = new MyFoliageGeneratingPass(); m_foliageRenderer = new MyFoliageRenderingPass(); }
internal static void Init() { ResetShadows(MyRenderProxy.Settings.ShadowCascadeCount, RenderSettings.ShadowQuality.ShadowCascadeResolution()); DynamicGeometryRenderer = new MyGeometryRenderer(MyScene.DynamicRenderablesDBVH, DynamicShadows); if (MyScene.SeparateGeometry) StaticGeometryRenderer = new MyGeometryRenderer(MyScene.StaticRenderablesDBVH, StaticShadows); m_foliageGenerator = new MyFoliageGeneratingPass(); m_foliageRenderer = new MyFoliageRenderingPass(); }
internal static void Init() { DynamicGeometryRenderer = new MyGeometryRenderer(MyScene.DynamicRenderablesDBVH, DynamicShadows); if (MyScene.SeparateGeometry) { StaticGeometryRenderer = new MyGeometryRenderer(MyScene.StaticRenderablesDBVH, StaticShadows); } m_foliageGenerator = new MyFoliageGeneratingPass(); m_foliageRenderer = new MyFoliageRenderingPass(); }
internal static void Init() { ResetShadows(MyRenderProxy.Settings.ShadowCascadeCount, RenderSettings.ShadowQuality.ShadowCascadeResolution()); DynamicGeometryRenderer = new MyGeometryRenderer(MyScene.DynamicRenderablesDBVH, DynamicShadows); if (MyScene.SeparateGeometry) { StaticGeometryRenderer = new MyGeometryRenderer(MyScene.StaticRenderablesDBVH, StaticShadows); } m_foliageGenerator = new MyFoliageGeneratingPass(); m_foliageRenderer = new MyFoliageRenderingPass(); }
internal void Render(MyFoliageRenderingPass foliageRenderer) { if (m_streams == null || m_streams.Count == 0) { return; } var renderableComponent = Owner.GetRenderable() as MyVoxelRenderableComponent; var proxy = renderableComponent.Lods[0].RenderableProxies[0]; var invScaleMat = MatrixD.CreateScale(1.0f / renderableComponent.m_voxelScale); var worldMat = proxy.WorldMatrix; worldMat.Translation -= MyEnvironment.CameraPosition; proxy.CommonObjectData.LocalMatrix = invScaleMat * worldMat; foreach (var materialStreamPair in m_streams) { foliageRenderer.RecordCommands(proxy, materialStreamPair.Value.m_stream, materialStreamPair.Key); } }
internal void Render(MyFoliageRenderingPass foliageRenderer) { if (m_streams == null || m_streams.Count == 0) return; var renderableComponent = Owner.GetRenderable() as MyVoxelRenderableComponent; var proxy = renderableComponent.Lods[0].RenderableProxies[0]; var invScaleMat = MatrixD.CreateScale(1.0f / renderableComponent.m_voxelScale); var worldMat = proxy.WorldMatrix; worldMat.Translation -= MyRender11.Environment.Matrices.CameraPosition; proxy.CommonObjectData.LocalMatrix = invScaleMat * worldMat; foreach(var materialStreamPair in m_streams) { foliageRenderer.RecordCommands(proxy, materialStreamPair.Value.m_stream, materialStreamPair.Key); } }