1
Fork 0
This repository has been archived on 2026-03-09. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
MariENB/menbprepassinternals.fx

137 lines
3.3 KiB
HLSL

/*
menbprepassinternals.fx : MariENB prepass internal variables.
(C)2013-2014 Marisa Kirisame, UnSX Team.
Part of MariENB, the personal ENB of Marisa.
Released under the MIT License.
*/
/* mathematical constants */
static const float pi = 3.1415926535898;
/* gaussian blur matrices */
static const float2x2 gauss3 =
{
0.16,0.12,
0.12,0.09
};
static const float3x3 gauss5 =
{
0.0865051903114,0.0692041522491,0.0346020761246,
0.0692041522491,0.0553633217993,0.0276816609,
0.0346020761246,0.0276816609,0.01384083045
};
static const float4x4 gauss7 =
{
0.0632507440209,0.0527089533508,0.0301194019147,0.011294775718,
0.0527089533508,0.0439241277923,0.0250995015956,0.00941231309835,
0.0301194019147,0.0250995015956,0.01434257234,0.00537846462763,
0.011294775718,0.00941231309835,0.00537846462763,0.00201692423536
};
/* SSAO sample sphere */
static const float3 ssao_samples[16] =
{
float3( 0.5381, 0.1856,-0.4319),float3( 0.1379, 0.2486, 0.4430),
float3( 0.3371, 0.5679,-0.0057),float3(-0.6999,-0.0451,-0.0019),
float3( 0.0689,-0.1598,-0.8547),float3( 0.0560, 0.0069,-0.1843),
float3(-0.0146, 0.1402, 0.0762),float3( 0.0100,-0.1924,-0.0344),
float3(-0.3577,-0.5301,-0.4358),float3(-0.3169, 0.1063, 0.0158),
float3( 0.0103,-0.5869, 0.0046),float3(-0.0897,-0.4940, 0.3287),
float3( 0.7119,-0.0154,-0.0918),float3(-0.0533, 0.0596,-0.5411),
float3( 0.0352,-0.0631, 0.5460),float3(-0.4776, 0.2847,-0.0271)
};
/* standard stuff (not all used) */
float4 tempF1;
float4 tempF2;
float4 tempF3;
float4 Timer;
float4 ScreenSize;
float FadeFactor;
extern float fWaterLevel = 1.0;
/* samplers and textures (some unused) */
texture2D texColor;
texture2D texDepth;
texture2D texNoise;
texture2D texFocus;
texture2D texCurr;
texture2D texPrev;
sampler2D SamplerColor = sampler_state
{
Texture = <texColor>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Mirror;
AddressV = Mirror;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerDepth = sampler_state
{
Texture = <texDepth>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerNoise = sampler_state
{
Texture = <texNoise>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Wrap;
AddressV = Wrap;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerFocus = sampler_state
{
Texture = <texFocus>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerCurr = sampler_state
{
Texture = <texCurr>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
sampler2D SamplerPrev = sampler_state
{
Texture = <texPrev>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture = FALSE;
MaxMipLevel = 0;
MipMapLodBias = 0;
};
/* whatever */
struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord : TEXCOORD0;
};
struct VS_INPUT_POST
{
float3 pos : POSITION;
float2 txcoord : TEXCOORD0;
};