Files
UnrealEngineUWP/Engine/Shaders/AtmospherePrecomputeCommon.usf
Ben Marsh 149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00

48 lines
2.3 KiB
Plaintext

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
AtmospherePrecomputeCommon.usf: Functions and variables only used in precomputation in editor
This code contains embedded portions of free sample source code from
http://www-evasion.imag.fr/Membres/Eric.Bruneton/PrecomputedAtmosphericScattering2.zip, Author: Eric Bruneton,
08/16/2011, Copyright (c) 2008 INRIA, All Rights Reserved, which have been altered from their original version.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
=============================================================================*/
#ifndef __ATMOSPHERE_PRECOMPUTE_COMMON__
#define __ATMOSPHERE_PRECOMPUTE_COMMON__
/** Integration Parameters */
const static int TransmittanceIntegralSamples = 500;
const static int InscatterIntegralSamples = 50;
const static int IrradianceIntegralSamplesHalf = 16; // 32 / 2, division for integer has some problem in nVidia Card
const static int InscatterSphericalIntegralSamples = 16;
const static float DeltaPhi = PI / float(InscatterSphericalIntegralSamples);
const static float DeltaTheta = PI / float(InscatterSphericalIntegralSamples);
float FirstOrder;
/** Textures only for precomputation on editor */
Texture2D AtmosphereDeltaETexture;
SamplerState AtmosphereDeltaETextureSampler;
Texture3D AtmosphereDeltaSRTexture;
SamplerState AtmosphereDeltaSRTextureSampler;
Texture3D AtmosphereDeltaSMTexture;
SamplerState AtmosphereDeltaSMTextureSampler;
Texture3D AtmosphereDeltaJTexture;
SamplerState AtmosphereDeltaJTextureSampler;
#endif