public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); traceAttribute = GetTraceAttr(); intensityKey = LightVoxelShaderKeys.Intensity.ComposeWith(compositionName); specularIntensityKey = LightVoxelShaderKeys.SpecularIntensity.ComposeWith(compositionName); diffuseMarcherKey = LightVoxelShaderKeys.diffuseMarcher.ComposeWith(compositionName); specularMarcherKey = LightVoxelShaderKeys.specularMarcher.ComposeWith(compositionName); attributeSamplersKey = MarchAttributesKeys.AttributeSamplers.ComposeWith(compositionName); if (traceAttribute != null) { if (((LightVoxel)Light.Type).DiffuseMarcher != null) { ((LightVoxel)Light.Type).DiffuseMarcher.UpdateMarchingLayout("diffuseMarcher." + compositionName); } if (((LightVoxel)Light.Type).SpecularMarcher != null) { ((LightVoxel)Light.Type).SpecularMarcher.UpdateMarchingLayout("specularMarcher." + compositionName); } traceAttribute.UpdateSamplingLayout("AttributeSamplers[0]." + compositionName); } }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); countKey = DirectLightGroupPerDrawKeys.LightCount.ComposeWith(compositionName); lightsKey = LightSpotGroupKeys.Lights.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); _countKey = DirectLightGroupPerViewKeys.LightCount.ComposeWith(compositionName); _lightsKey = AtmosphereLightDirectionalGroupKeys.Lights.ComposeWith(compositionName); _compositionName = compositionName; }
public DirectionalLightShaderGroupData(DirectionalLightShaderGroup group, ILightShadowMapShaderGroupData shadowGroupData) : base(shadowGroupData) { countKey = group.CountKey; lightsKey = group.LightsKey; lights = new DirectionalLightData[StaticLightMaxCount]; }
public SpotLightShaderGroup(ShaderMixinSource mixin, string compositionName, ILightShadowMapShaderGroupData shadowGroupData) : base(mixin, compositionName, shadowGroupData) { CountKey = DirectLightGroupKeys.LightCount.ComposeWith(compositionName); PositionsKey = LightPointGroupKeys.LightPositionWS.ComposeWith(compositionName); InvSquareRadiusKey = LightPointGroupKeys.LightInvSquareRadius.ComposeWith(compositionName); ColorsKey = LightPointGroupKeys.LightColor.ComposeWith(compositionName); }
public void UpdateLayout(string compositionName) { fragmentsBufferKey = VoxelStorageClipmapShaderKeys.fragmentsBuffer.ComposeWith(compositionName); clipMapResolutionKey = VoxelStorageClipmapShaderKeys.clipMapResolution.ComposeWith(compositionName); storageUintsKey = VoxelStorageClipmapShaderKeys.storageUints.ComposeWith(compositionName); clipMapCountKey = VoxelStorageClipmapShaderKeys.clipMapCount.ComposeWith(compositionName); VoxelMatrixKey = VoxelStorageClipmapShaderKeys.VoxelMatrix.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); TextureProjectionShaderGroupData?.UpdateLayout(compositionName); countKey = DirectLightGroupPerDrawKeys.LightCount.ComposeWith(compositionName); lightsKey = LightSpotGroupKeys.Lights.ComposeWith(compositionName); }
public SpotLightShaderGroupData(SpotLightShaderGroup group, ILightShadowMapShaderGroupData shadowGroupData) : base(shadowGroupData) { countKey = group.CountKey; lightsKey = group.LightsKey; lights = new SpotLightData[StaticLightMaxCount]; }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); TextureProjectionShaderGroupData?.UpdateLayout(compositionName); countKey = DirectLightGroupPerDrawKeys.LightCount.ComposeWith(compositionName); lightsKey = LightClusteredPointSpotGroupRenderer.UseLinearLighting ? LightSpotGroupLinearKeys.Lights.ComposeWith(compositionName) : LightSpotGroupKeys.Lights.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionName); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionName); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionName); worldToShadowCascadeUVsKey = ShadowMapReceiverBaseKeys.WorldToShadowCascadeUV.ComposeWith(compositionName); depthBiasesKey = ShadowMapReceiverBaseKeys.DepthBiases.ComposeWith(compositionName); offsetScalesKey = ShadowMapReceiverBaseKeys.OffsetScales.ComposeWith(compositionName); }
public DirectionalLightShaderGroupData(DirectionalLightShaderGroup group, ILightShadowMapShaderGroupData shadowGroupData) : base(shadowGroupData) { countKey = group.CountKey; directionsKey = group.DirectionsKey; colorsKey = group.ColorsKey; lightDirections = new Vector3[StaticLightMaxCount]; lightColors = new Color3[StaticLightMaxCount]; }
public void UpdateSamplerLayout(string compositionName) { ClipMapskey = VoxelStorageTextureClipmapShaderKeys.clipMaps.ComposeWith(compositionName); voxelSizeInvKey = VoxelStorageTextureClipmapShaderKeys.voxelSizeInv.ComposeWith(compositionName); voxelSizeKey = VoxelStorageTextureClipmapShaderKeys.voxelSize.ComposeWith(compositionName); MipMapskey = VoxelStorageTextureClipmapShaderKeys.mipMaps.ComposeWith(compositionName); clipCountKey = VoxelStorageTextureClipmapShaderKeys.clipCount.ComposeWith(compositionName); axisCountKey = VoxelStorageTextureClipmapShaderKeys.axisCount.ComposeWith(compositionName); matrixKey = VoxelStorageTextureClipmapShaderKeys.VoxelMatrix.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionName); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionName); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionName); worldToShadowKey = ShadowMapReceiverPointCubeMapKeys.WorldToShadow.ComposeWith(compositionName); depthBiasesKey = ShadowMapReceiverPointCubeMapKeys.DepthBiases.ComposeWith(compositionName); depthParametersKey = ShadowMapReceiverPointCubeMapKeys.DepthParameters.ComposeWith(compositionName); offsetScalesKey = ShadowMapReceiverPointCubeMapKeys.OffsetScales.ComposeWith(compositionName); }
public void UpdateLayout(string compositionName) { projectiveTextureKey = TextureProjectionKeys.ProjectionTexture.ComposeWith(compositionName); uvScale = TextureProjectionKeys.UVScale.ComposeWith(compositionName); uvOffset = TextureProjectionKeys.UVOffset.ComposeWith(compositionName); worldToProjectiveTextureUVsKey = TextureProjectionReceiverBaseKeys.WorldToProjectiveTextureUV.ComposeWith(compositionName); projectorPlaneMatricesKey = TextureProjectionReceiverBaseKeys.ProjectorPlaneMatrices.ComposeWith(compositionName); projectionTextureMipMapLevelsKey = TextureProjectionReceiverBaseKeys.ProjectionTextureMipMapLevels.ComposeWith(compositionName); transitionAreasKey = TextureProjectionReceiverBaseKeys.TransitionAreas.ComposeWith(compositionName); }
public void UpdateLayout(string compositionKey) { shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionKey); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionKey); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionKey); cascadeSplitsKey = ShadowMapReceiverDirectionalKeys.CascadeDepthSplits.ComposeWith(compositionKey); worldToShadowCascadeUVsKey = ShadowMapReceiverBaseKeys.WorldToShadowCascadeUV.ComposeWith(compositionKey); depthBiasesKey = ShadowMapReceiverBaseKeys.DepthBiases.ComposeWith(compositionKey); offsetScalesKey = ShadowMapReceiverBaseKeys.OffsetScales.ComposeWith(compositionKey); }
public void UpdateMarchingLayout(string compositionName) { if (EditMode) { StepsKey = VoxelMarchConeEditModeKeys.steps.ComposeWith(compositionName); StepScaleKey = VoxelMarchConeEditModeKeys.stepScale.ComposeWith(compositionName); ConeRatioKey = VoxelMarchConeEditModeKeys.coneRatio.ComposeWith(compositionName); FastKey = VoxelMarchConeEditModeKeys.fast.ComposeWith(compositionName); OffsetKey = VoxelMarchConeEditModeKeys.offset.ComposeWith(compositionName); } }
public LightSkyBoxShaderGroupData(LightSkyBoxShaderGroup group) : base(null) { intensityKey = group.IntensityKey; skyMatrixKey = group.SkyMatrixKey; lightDiffuseColorKey = group.LightDiffuseColorKey; lightSpecularColorKey = group.LightSpecularColorKey; sphericalColorsKey = group.SphericalColorsKey; specularCubeMapkey = group.SpecularCubeMapkey; specularMipCountKey = group.SpecularMipCountKey; }
public LightSkyBoxShaderGroup(ShaderSource mixin, string compositionName) : base(mixin, compositionName, null) { IntensityKey = LightSkyboxShaderKeys.Intensity.ComposeWith(compositionName); SkyMatrixKey = LightSkyboxShaderKeys.SkyMatrix.ComposeWith(compositionName); LightDiffuseColorKey = LightSkyboxShaderKeys.LightDiffuseColor.ComposeWith(compositionName); LightSpecularColorKey = LightSkyboxShaderKeys.LightSpecularColor.ComposeWith(compositionName); SphericalColorsKey = SphericalHarmonicsEnvironmentColorKeys.SphericalColors.ComposeWith("lightDiffuseColor." + compositionName); SpecularCubeMapkey = RoughnessCubeMapEnvironmentColorKeys.CubeMap.ComposeWith("lightSpecularColor." + compositionName); SpecularMipCountKey = RoughnessCubeMapEnvironmentColorKeys.MipCount.ComposeWith("lightSpecularColor." + compositionName); }
public override void UpdateLayout(string compositionName) { shadowMapTextureKey = ShadowMapKeys.ShadowMapTexture.ComposeWith(compositionName); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionName); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionName); offsetsKey = ShadowMapReceiverPointParaboloidKeys.FaceOffsets.ComposeWith(compositionName); backfaceOffsetsKey = ShadowMapReceiverPointParaboloidKeys.BackfaceOffsets.ComposeWith(compositionName); faceSizesKey = ShadowMapReceiverPointParaboloidKeys.FaceSizes.ComposeWith(compositionName); depthParametersKey = ShadowMapReceiverPointParaboloidKeys.DepthParameters.ComposeWith(compositionName); viewKey = ShadowMapReceiverPointParaboloidKeys.View.ComposeWith(compositionName); depthBiasesKey = ShadowMapReceiverPointParaboloidKeys.DepthBiases.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); intensityKey = LightSkyboxShaderKeys.Intensity.ComposeWith(compositionName); skyMatrixKey = LightSkyboxShaderKeys.SkyMatrix.ComposeWith(compositionName); lightDiffuseColorKey = LightSkyboxShaderKeys.LightDiffuseColor.ComposeWith(compositionName); lightSpecularColorKey = LightSkyboxShaderKeys.LightSpecularColor.ComposeWith(compositionName); sphericalColorsKey = SphericalHarmonicsEnvironmentColorKeys.SphericalColors.ComposeWith("lightDiffuseColor." + compositionName); specularCubeMapkey = RoughnessCubeMapEnvironmentColorKeys.CubeMap.ComposeWith("lightSpecularColor." + compositionName); specularMipCountKey = RoughnessCubeMapEnvironmentColorKeys.MipCount.ComposeWith("lightSpecularColor." + compositionName); }
public SpotLightShaderGroupData(SpotLightShaderGroup group, ILightShadowMapShaderGroupData shadowGroupData) : base(shadowGroupData) { countKey = group.CountKey; colorsKey = group.ColorsKey; positionsKey = group.PositionsKey; invSquareRadiusKey = group.InvSquareRadiusKey; lightDirections = new Vector3[StaticLightMaxCount]; lightColors = new Color3[StaticLightMaxCount]; lightPositions = new Vector3[StaticLightMaxCount]; invSquareRadius = new float[StaticLightMaxCount]; }
public void UpdateVoxelizationLayout(string compositionName) { fragmentsBufferKey = VoxelStorageClipmapShaderKeys.fragmentsBuffer.ComposeWith(compositionName); clipMapResolutionKey = VoxelStorageClipmapShaderKeys.clipMapResolution.ComposeWith(compositionName); storageUintsKey = VoxelStorageClipmapShaderKeys.storageUints.ComposeWith(compositionName); if (UpdatesOneClipPerFrame()) { clipScaleKey = VoxelStorageClipmapShaderKeys.clipScale.ComposeWith(compositionName); clipOffsetKey = VoxelStorageClipmapShaderKeys.clipOffset.ComposeWith(compositionName); clipPosKey = VoxelStorageClipmapShaderKeys.clipPos.ComposeWith(compositionName); } else { clipMapCountKey = VoxelStorageClipmapShaderKeys.clipMapCount.ComposeWith(compositionName); perClipMapOffsetScaleKey = VoxelStorageClipmapShaderKeys.perClipMapOffsetScale.ComposeWith(compositionName); } }
/// <summary> /// Initializes a new instance of the <see cref="LightDirectionalShadowMapGroupShaderData" /> class. /// </summary> /// <param name="compositionKey">The composition key.</param> /// <param name="shadowType">Type of the shadow.</param> /// <param name="lightCountMax">The light count maximum.</param> public LightDirectionalShadowMapGroupShaderData(string compositionKey, LightShadowType shadowType, int lightCountMax) { this.shadowType = shadowType; this.cascadeCount = 1 << ((int)(shadowType & LightShadowType.CascadeMask) - 1); cascadeSplits = new float[cascadeCount * lightCountMax]; worldToShadowCascadeUV = new Matrix[cascadeCount * lightCountMax]; depthBiases = new float[lightCountMax]; offsetScales = new float[lightCountMax]; var mixin = new ShaderMixinSource(); var isDepthRangeAuto = (this.shadowType & LightShadowType.DepthRangeAuto) != 0; mixin.Mixins.Add(new ShaderClassSource(ShaderName, cascadeCount, lightCountMax, (this.shadowType & LightShadowType.BlendCascade) != 0 && !isDepthRangeAuto, isDepthRangeAuto, (this.shadowType & LightShadowType.Debug) != 0)); // TODO: Temporary passing filter here switch (shadowType & LightShadowType.FilterMask) { case LightShadowType.PCF3x3: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 3)); break; case LightShadowType.PCF5x5: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 5)); break; case LightShadowType.PCF7x7: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 7)); break; default: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterDefault")); break; } shadowShader = mixin; shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionKey); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionKey); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionKey); cascadeSplitsKey = ShadowMapReceiverDirectionalKeys.CascadeDepthSplits.ComposeWith(compositionKey); worldToShadowCascadeUVsKey = ShadowMapReceiverBaseKeys.WorldToShadowCascadeUV.ComposeWith(compositionKey); depthBiasesKey = ShadowMapReceiverBaseKeys.DepthBiases.ComposeWith(compositionKey); offsetScalesKey = ShadowMapReceiverBaseKeys.OffsetScales.ComposeWith(compositionKey); }
public override void UpdateLayout(string compositionName) { base.UpdateLayout(compositionName); intensityKey = LightVoxelShaderKeys.Intensity.ComposeWith(compositionName); intensityBounceScaleKey = LightVoxelShaderKeys.IntensityBounceScale.ComposeWith(compositionName); voxelMatrixKey = LightVoxelShaderKeys.VoxelMatrix.ComposeWith(compositionName); lightDiffuseVoxelColorKey = LightVoxelShaderKeys.LightDiffuseVoxelColor.ComposeWith(compositionName); voxelVolumekey = IsotropicVoxelColorKeys.VoxelVolume.ComposeWith("lightDiffuseVoxelColor." + compositionName); mipMapsVolumekey = IsotropicVoxelColorKeys.VoxelMipMaps.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR1 = IsotropicVoxelColorKeys.VoxelVolumeR1.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR2 = IsotropicVoxelColorKeys.VoxelVolumeR2.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR3 = IsotropicVoxelColorKeys.VoxelVolumeR3.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR4 = IsotropicVoxelColorKeys.VoxelVolumeR4.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR5 = IsotropicVoxelColorKeys.VoxelVolumeR5.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumekeyR6 = IsotropicVoxelColorKeys.VoxelVolumeR6.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumeMipCountKey = IsotropicVoxelColorKeys.MipCount.ComposeWith("lightDiffuseVoxelColor." + compositionName); voxelVolumeClipMapCountKey = IsotropicVoxelColorKeys.ClipMapCount.ComposeWith("lightDiffuseVoxelColor." + compositionName); }
/// <summary> /// Initializes a new instance of the <see cref="LightSpotShadowMapGroupShaderData" /> class. /// </summary> /// <param name="compositionKey">The composition key.</param> /// <param name="shadowType">Type of the shadow.</param> /// <param name="lightCountMax">The light count maximum.</param> public LightSpotShadowMapGroupShaderData(string compositionKey, LightShadowType shadowType, int lightCountMax) { this.shadowType = shadowType; worldToShadowCascadeUV = new Matrix[lightCountMax]; depthBiases = new float[lightCountMax]; offsetScales = new float[lightCountMax]; var mixin = new ShaderMixinSource(); mixin.Mixins.Add(new ShaderClassSource(ShaderName, lightCountMax, (this.shadowType & LightShadowType.Debug) != 0)); // TODO: Temporary passing filter here switch (shadowType & LightShadowType.FilterMask) { case LightShadowType.PCF3x3: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 3)); break; case LightShadowType.PCF5x5: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 5)); break; case LightShadowType.PCF7x7: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterPcf", 7)); break; default: mixin.Mixins.Add(new ShaderClassSource("ShadowMapFilterDefault")); break; } shadowShader = mixin; shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionKey); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionKey); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionKey); worldToShadowCascadeUVsKey = ShadowMapReceiverBaseKeys.WorldToShadowCascadeUV.ComposeWith(compositionKey); depthBiasesKey = ShadowMapReceiverBaseKeys.DepthBiases.ComposeWith(compositionKey); offsetScalesKey = ShadowMapReceiverBaseKeys.OffsetScales.ComposeWith(compositionKey); }
/// <summary> /// Sets a blittable of the material pass parameter. Cloning the <see cref="Material"/> if required. /// </summary> /// <typeparam name="T">The type of value.</typeparam> /// <param name="modelComponent">The <see cref="ModelComponent"/> to update material parameter on.</param> /// <param name="parameter">The parameter to update.</param> /// <param name="value">The value.</param> /// <param name="materialIndex">The index of the material to update. Default is 0.</param> /// <param name="passIndex">The index of the pass of the material to update. Default is 0.</param> /// <exception cref="ArgumentNullException">If <paramref name="modelComponent"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentOutOfRangeException"> /// If <paramref name="materialIndex"/> is less than 0 or greater than <see cref="ModelComponent.GetMaterialCount"/> and not in <see cref="ModelComponent.Materials"/>. /// Or if <paramref name="passIndex"/> is less than 0 or greater than or equal to the mu,ber of passes the material has. /// </exception> public static void SetMaterialParameter <T>(this ModelComponent modelComponent, ValueParameterKey <T> parameter, T value, int materialIndex = 0, int passIndex = 0) where T : struct { modelComponent.GetMaterialPassParameters(materialIndex, passIndex).Set(parameter, value); }
public ShaderSource Generate(MaterialGeneratorContext context, ValueParameterKey <float> uniqueAlphaThresholdKey) { return(new ShaderClassSource("MaterialHairDiscardFunctionTransparentPass", uniqueAlphaThresholdKey)); }
public void UpdateLayout(string compositionName) { AmountKey = VoxelModifierApplierOpacifyIsotropicKeys.Amount.ComposeWith(compositionName); }
public DirectionalLightShaderGroup(ShaderMixinSource mixin, string compositionName, ILightShadowMapShaderGroupData shadowGroupData) : base(mixin, compositionName, shadowGroupData) { CountKey = DirectLightGroupKeys.LightCount.ComposeWith(compositionName); LightsKey = LightDirectionalGroupKeys.Lights.ComposeWith(compositionName); }
public override void UpdateLayout(string compositionName) { ambientLightKey = LightSimpleAmbientKeys.AmbientLight.ComposeWith(compositionName); }
public void UpdateLayout(string compositionKey) { shadowMapTextureKey = ShadowMapKeys.Texture.ComposeWith(compositionKey); shadowMapTextureSizeKey = ShadowMapKeys.TextureSize.ComposeWith(compositionKey); shadowMapTextureTexelSizeKey = ShadowMapKeys.TextureTexelSize.ComposeWith(compositionKey); worldToShadowCascadeUVsKey = ShadowMapReceiverBaseKeys.WorldToShadowCascadeUV.ComposeWith(compositionKey); depthBiasesKey = ShadowMapReceiverBaseKeys.DepthBiases.ComposeWith(compositionKey); offsetScalesKey = ShadowMapReceiverBaseKeys.OffsetScales.ComposeWith(compositionKey); }
public LightAmbientShaderGroupData(LightAmbientShaderGroup group) : base(null) { ambientLightKey = group.AmbientLightKey; }