protected override void InitializeCore() { base.InitializeCore(); // TODO: Make this pluggable if (Context.GraphicsDevice.Features.RequestedProfile >= GraphicsProfile.Level_10_0) { // Note: this renderer supports both Point and Spot lights var clusteredLightRenderer = new LightClusteredPointGroupRenderer(); RegisterLightGroupRenderer(typeof(LightPoint), clusteredLightRenderer); RegisterLightGroupRenderer(typeof(LightSpot), new LightSpotGroupRenderer { NonShadowRenderer = clusteredLightRenderer.SpotRenderer }); } else { RegisterLightGroupRenderer(typeof(LightPoint), new LightPointGroupRenderer()); RegisterLightGroupRenderer(typeof(LightSpot), new LightSpotGroupRenderer()); } RegisterLightGroupRenderer(typeof(LightDirectional), new LightDirectionalGroupRenderer()); RegisterLightGroupRenderer(typeof(LightAmbient), new LightAmbientRenderer()); RegisterLightGroupRenderer(typeof(LightSkybox), new LightSkyboxRenderer()); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; viewLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateViewLogicalGroup("Lighting"); drawLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawLogicalGroup("Lighting"); }
/// <inheritdoc/> protected override void InitializeCore() { renderModelObjectInfoKey = RootRenderFeature.RenderData.CreateObjectKey<RenderModelFrameInfo>(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; blendMatrices = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationSkinningKeys.BlendMatrixArray.Name); }
protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; VoxelizerStorerCasterKey = ((RootEffectRenderFeature)RootRenderFeature).CreateViewLogicalGroup("VoxelizerStorer"); }
protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; renderViewObjectInfoKey = RootRenderFeature.RenderData.CreateViewObjectKey <LightParametersPermutationEntry>(); perLightingDescriptorSetSlot = ((RootEffectRenderFeature)RootRenderFeature).GetOrCreateEffectDescriptorSetSlot("PerLighting"); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; tessellationStateKey = RootRenderFeature.RenderData.CreateStaticObjectKey <TessellationState>(); perMaterialDescriptorSetSlot = ((RootEffectRenderFeature)RootRenderFeature).GetOrCreateEffectDescriptorSetSlot("PerMaterial"); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = RenderEffectKey; view = CreateViewCBufferOffsetSlot(ParticleBaseKeys.MatrixTransform.Name); perMaterialDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerMaterial"); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; fog = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(FogEffectKeys.FogColor.Name); bend = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationBendWorldKeys.DeformFactorX.Name); uvChange = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationTextureUVKeys.TextureRegion.Name); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; fog = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(FogEffectKeys.FogColor.Name); bend = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationBendWorldKeys.DeformFactorX.Name); uvChange = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(TransformationTextureUVKeys.TextureRegion.Name); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = RenderEffectKey; // The offset starts with the first element in the buffer perViewCBufferOffset = CreateViewCBufferOffsetSlot(ParticleUtilitiesKeys.ViewMatrix.Name); perMaterialDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerMaterial"); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = RenderEffectKey; // The offset starts with the first element in the buffer perViewCBufferOffset = CreateViewCBufferOffsetSlot(ParticleUtilitiesKeys.ViewMatrix.Name); perMaterialDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerMaterial"); }
public VisibilityGroup(RenderSystem renderSystem) { RenderSystem = renderSystem; RenderObjects = new RenderObjectCollection(this); RenderData.Initialize(ComputeDataArrayExpectedSize); // Create RenderStageMask key, and keep track of number of RenderStages.Count for future resizing RenderStageMaskKey = RenderData.CreateStaticObjectKey<uint>(null, stageMaskMultiplier = (RenderSystem.RenderStages.Count + RenderStageMaskSizePerEntry - 1) / RenderStageMaskSizePerEntry); Array.Resize(ref viewRenderStageMask, stageMaskMultiplier); RenderSystem.RenderStages.CollectionChanged += RenderStages_CollectionChanged; RenderSystem.RenderStageSelectorsChanged += RenderSystem_RenderStageSelectorsChanged; RenderSystem.RenderFeatures.CollectionChanged += RenderFeatures_CollectionChanged; }
protected override void InitializeCore() { base.InitializeCore(); // Initialize light renderers foreach (var lightRenderer in lightRenderers) { lightRenderer.Initialize(Context); } EvaluateLightTypes(); // Track changes lightRenderers.CollectionChanged += LightRenderers_CollectionChanged; renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; viewLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateViewLogicalGroup("Lighting"); drawLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawLogicalGroup("Lighting"); }
protected override void InitializeCore() { base.InitializeCore(); // TODO: Make this pluggable if (Context.GraphicsDevice.Features.RequestedProfile >= GraphicsProfile.Level_10_0) { // Note: this renderer supports both Point and Spot lights var clusteredLightRenderer = new LightClusteredPointGroupRenderer(); RegisterLightGroupRenderer(typeof(LightPoint), clusteredLightRenderer); RegisterLightGroupRenderer(typeof(LightSpot), new LightSpotGroupRenderer { NonShadowRenderer = clusteredLightRenderer.SpotRenderer }); } else { RegisterLightGroupRenderer(typeof(LightPoint), new LightPointGroupRenderer()); RegisterLightGroupRenderer(typeof(LightSpot), new LightSpotGroupRenderer()); } RegisterLightGroupRenderer(typeof(LightDirectional), new LightDirectionalGroupRenderer()); RegisterLightGroupRenderer(typeof(LightAmbient), new LightAmbientRenderer()); RegisterLightGroupRenderer(typeof(LightSkybox), new LightSkyboxRenderer()); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; viewLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateViewLogicalGroup("Lighting"); drawLightingKey = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawLogicalGroup("Lighting"); }
/// <inheritdoc/> protected override void InitializeCore() { perDrawData = ((RootEffectRenderFeature)RootRenderFeature).CreateDrawCBufferOffsetSlot(MaterialFrontBackBlendShaderKeys.ColorFront.Name); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); prepareThreadContext = new ThreadLocal<PrepareThreadContext>(() => new PrepareThreadContext(Context)); // Create RenderEffectKey RenderEffectKey = RenderData.CreateStaticObjectKey<RenderEffect>(null, EffectPermutationSlotCount); // TODO: Assign weights so that PerDraw is always last? (we usually most custom user ones to be between PerView and PerDraw) perFrameDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerFrame"); perViewDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerView"); perDrawDescriptorSetSlot = GetOrCreateEffectDescriptorSetSlot("PerDraw"); RenderSystem.RenderStages.CollectionChanged += RenderStages_CollectionChanged; // Create effect slots Array.Resize(ref effectSlots, RenderSystem.RenderStages.Count); for (int index = 0; index < RenderSystem.RenderStages.Count; index++) { var renderStage = RenderSystem.RenderStages[index]; effectSlots[index] = CreateEffectPermutationSlot(renderStage.EffectSlotName); } }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; tessellationStateKey = RootRenderFeature.RenderData.CreateStaticObjectKey<TessellationState>(); perMaterialDescriptorSetSlot = ((RootEffectRenderFeature)RootRenderFeature).GetOrCreateEffectDescriptorSetSlot("PerMaterial"); }
/// <inheritdoc/> protected override void InitializeCore() { base.InitializeCore(); renderEffectKey = ((RootEffectRenderFeature)RootRenderFeature).RenderEffectKey; }