internal MyMergeInstancing(MyMeshTableSrv meshTable) { m_meshTable = meshTable; m_instancesDataDirty = false; m_tableDirty = false; }
internal MyMaterialMergeGroup(MyMeshTableSrv meshTable, MyMeshMaterialId matId, int index) { m_mergeGroup = new MyMergeInstancing(meshTable); m_rootMaterialRK = MyMeshMaterials1.Table[matId.Index].RepresentationKey; Index = index; m_actors = new Dictionary <uint, MyActor>(); m_actorIndices = new Dictionary <MyActor, int>(); }
internal void AddEntity(MyActor actor, MeshId model) { uint ID = actor.ID; var instanceIndex = m_perInstance.Allocate(); var entityIndex = m_entityInfos.Allocate(); Debug.Assert(instanceIndex == entityIndex); m_entities[ID] = new MyInstanceInfo { InstanceIndex = instanceIndex, PageHandles = new List <MyPackedPoolHandle>() }; int pageOffset = -1; var key = MyMeshTableSrv.MakeKey(model); foreach (var id in m_meshTable.Pages(key)) { if (pageOffset == -1) { pageOffset = id; } var pageHandle = m_instancingTable.Allocate(); m_instancingTable.Data[m_instancingTable.AsIndex(pageHandle)] = new MyInstancingTableEntry { InstanceId = instanceIndex, InnerMeshId = id }; m_entities[ID].PageHandles.Add(pageHandle); } m_perInstance.Data[instanceIndex] = MyPerInstanceData.FromWorldMatrix(ref MatrixD.Zero, 0); m_entityInfos.Data[instanceIndex] = new MyInstanceEntityInfo { EntityId = ID, PageOffset = pageOffset }; m_tableDirty = true; }
internal static unsafe void InitSubsystems() { MyManagers.OnDeviceInit(); //MyRwTextures.Init(); MyHwBuffers.Init(); ResetShadows(MyShadowCascades.Settings.NewData.CascadesCount, RenderSettings.ShadowQuality.ShadowCascadeResolution()); MyRender11.Init(); MyCommon.Init(); MyVertexLayouts.Init(); MyShaders.Init(); MyMeshes.Init(); MyMeshTableSrv.Init(); MyLightRendering.Init(); MyLinesRenderer.Init(); MySpritesRenderer.Init(); MyPrimitivesRenderer.Init(); MyOutline.Init(); MyBlur.Init(); MyTransparentRendering.Init(); MyFoliageComponents.Init(); MyBillboardRenderer.Init(); // hardcoded limits MyDebugRenderer.Init(); MyScreenDecals.Init(); MyEnvProbeProcessing.Init(); MyAtmosphereRenderer.Init(); MyCloudRenderer.Init(); MyAAEdgeMarking.Init(); MyScreenPass.Init(); MyCopyToRT.Init(); MyBlendTargets.Init(); MyFXAA.Init(); MyDepthResolve.Init(); MyBloom.Init(); MyLuminanceAverage.Init(); MyToneMapping.Init(); MySSAO.Init(); MyHdrDebugTools.Init(); MySceneMaterials.Init(); MyMaterials1.Init(); MyVoxelMaterials1.Init(); MyMeshMaterials1.Init(); MyHBAO.Init(); try { if (m_settings.UseStereoRendering) { var openVR = new MyOpenVR(); MyStereoStencilMask.InitUsingOpenVR(); } } catch (System.Exception e) { if (!VRage.MyCompilationSymbols.DX11ForceStereo) { throw; } MyStereoStencilMask.InitUsingUndefinedMask(); } }
internal MyMaterialMergeGroup(MyMeshTableSrv meshTable, MyMeshMaterialId matId, int index) { m_mergeGroup = new MyMergeInstancing(meshTable); m_rootMaterialRK = MyMeshMaterials1.Table[matId.Index].RepresentationKey; Index = index; m_actors = new Dictionary<uint, MyActor>(); m_actorIndices = new Dictionary<MyActor, int>(); }