Exemple #1
0
        public DensityVolumeData GetData()
        {
            DensityVolumeData data = new DensityVolumeData();

            data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath);
            data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo);

            return(data);
        }
Exemple #2
0
        public override void PushShaderParameters(CommandBuffer cmd, FrameSettings frameSettings)
        {
            DensityVolumeParameters param = new DensityVolumeParameters(albedo, meanFreePath, anisotropy);

            DensityVolumeData data = param.GetData();

            cmd.SetGlobalInt(HDShaderIDs._AtmosphericScatteringType, (int)FogType.Volumetric);

            cmd.SetGlobalVector(HDShaderIDs._GlobalScattering, data.scattering);
            cmd.SetGlobalFloat(HDShaderIDs._GlobalExtinction, data.extinction);
            cmd.SetGlobalFloat(HDShaderIDs._GlobalAnisotropy, anisotropy);
        }
        public DensityVolumeData GetData()
        {
            DensityVolumeData data = new DensityVolumeData();

            data.extinction = VolumeRenderingUtils.ExtinctionFromMeanFreePath(meanFreePath);
            data.scattering = VolumeRenderingUtils.ScatteringFromExtinctionAndAlbedo(data.extinction, (Vector3)(Vector4)albedo);

            data.textureIndex  = textureIndex;
            data.textureScroll = volumeScrollingAmount;
            data.textureTiling = textureTiling;

            return(data);
        }
Exemple #4
0
        public static void PushNeutralShaderParameters(CommandBuffer cmd)
        {
            cmd.SetGlobalInt(HDShaderIDs._AtmosphericScatteringType, (int)FogType.None);

            // In case volumetric lighting is enabled, we need to make sure that all rendering passes
            // (not just the atmospheric scattering one) receive neutral parameters.
            if (ShaderConfig.s_VolumetricLightingPreset != 0)
            {
                var data = DensityVolumeData.GetNeutralValues();

                cmd.SetGlobalVector(HDShaderIDs._GlobalScattering, data.scattering);
                cmd.SetGlobalFloat(HDShaderIDs._GlobalExtinction, data.extinction);
                cmd.SetGlobalFloat(HDShaderIDs._GlobalAnisotropy, 0.0f);
            }
        }
        public override void PushShaderParameters(CommandBuffer cmd, FrameSettings frameSettings)
        {
            DensityVolumeParameters param;

            param.albedo       = albedo;
            param.meanFreePath = meanFreePath;
            param.asymmetry    = asymmetry;

            DensityVolumeData data = param.GetData();

            cmd.SetGlobalInt(HDShaderIDs._AtmosphericScatteringType, (int)FogType.Volumetric);

            cmd.SetGlobalVector(HDShaderIDs._GlobalScattering, data.scattering);
            cmd.SetGlobalFloat(HDShaderIDs._GlobalExtinction, data.extinction);
            cmd.SetGlobalFloat(HDShaderIDs._GlobalAsymmetry, asymmetry);
        }