diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-02-11 19:37:57 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-02-11 19:37:57 +0000 |
| commit | e22e26af0f45e617e83e2ff0d4690fb3171345a8 (patch) | |
| tree | af3df6c15cce4df143320dd69d473baa60dc1e46 /Shaders/PostProcess | |
| parent | Renamed ScreenSizeQuad into FullScreenTriangle (diff) | |
| download | DiligentFX-e22e26af0f45e617e83e2ff0d4690fb3171345a8.tar.gz DiligentFX-e22e26af0f45e617e83e2ff0d4690fb3171345a8.zip | |
Split Structures.fxh into BasicStructures.fxh and EpipolarLightScatteringStrucutures.fxh
Diffstat (limited to 'Shaders/PostProcess')
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/AtmosphereShadersCommon.fxh | 2 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/CoarseInsctr.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/RayMarch.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/ReconstructCameraSpaceZ.fx | 2 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/RefineSampleLocations.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/RenderSliceEndPoints.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/SliceUVDirection.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/Sun.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/private/UnwarpEpipolarScattering.fx | 1 | ||||
| -rw-r--r-- | Shaders/PostProcess/EpipolarLightScattering/public/EpipolarLightScatteringStructures.fxh (renamed from Shaders/PostProcess/EpipolarLightScattering/public/Structures.fxh) | 105 |
10 files changed, 12 insertions, 104 deletions
diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/AtmosphereShadersCommon.fxh b/Shaders/PostProcess/EpipolarLightScattering/private/AtmosphereShadersCommon.fxh index 525020e..eecb81d 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/AtmosphereShadersCommon.fxh +++ b/Shaders/PostProcess/EpipolarLightScattering/private/AtmosphereShadersCommon.fxh @@ -1,7 +1,7 @@ #ifndef _ATMOSPHERE_SHADERS_COMMON_FXH_ #define _ATMOSPHERE_SHADERS_COMMON_FXH_ -#include "Structures.fxh" +#include "EpipolarLightScatteringStructures.fxh" #define FLT_MAX 3.402823466e+38f diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/CoarseInsctr.fx b/Shaders/PostProcess/EpipolarLightScattering/private/CoarseInsctr.fx index 12f05ba..d02ebff 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/CoarseInsctr.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/CoarseInsctr.fx @@ -3,6 +3,7 @@ // Coarse inscattering is used to refine sampling, while extinction is then transformed to // screen space, if extinction evaluation mode is EXTINCTION_EVAL_MODE_EPIPOLAR +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" cbuffer cbParticipatingMediaScatteringParams diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/RayMarch.fx b/Shaders/PostProcess/EpipolarLightScattering/private/RayMarch.fx index c9b822e..697e1e4 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/RayMarch.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/RayMarch.fx @@ -1,6 +1,7 @@ //RayMarch.fx //Performs ray marching and computes shadowed scattering +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" cbuffer cbParticipatingMediaScatteringParams diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/ReconstructCameraSpaceZ.fx b/Shaders/PostProcess/EpipolarLightScattering/private/ReconstructCameraSpaceZ.fx index 88b701c..d57c668 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/ReconstructCameraSpaceZ.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/ReconstructCameraSpaceZ.fx @@ -1,7 +1,7 @@ // ReconstructCameraSpaceZ.fx // Reconstructs camera space z from depth -#include "Structures.fxh" +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" Texture2D<float> g_tex2DDepthBuffer; diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/RefineSampleLocations.fx b/Shaders/PostProcess/EpipolarLightScattering/private/RefineSampleLocations.fx index 94781b1..d8b6c4c 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/RefineSampleLocations.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/RefineSampleLocations.fx @@ -1,6 +1,7 @@ // RefineSampleLocations.fx // Refines sample locations using inscattering difference or z difference +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" // In fact we only need RG16U texture to store diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/RenderSliceEndPoints.fx b/Shaders/PostProcess/EpipolarLightScattering/private/RenderSliceEndPoints.fx index 67b8324..def7e81 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/RenderSliceEndPoints.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/RenderSliceEndPoints.fx @@ -1,4 +1,5 @@ +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" cbuffer cbLightParams diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/SliceUVDirection.fx b/Shaders/PostProcess/EpipolarLightScattering/private/SliceUVDirection.fx index 42d4a8a..bd73f56 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/SliceUVDirection.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/SliceUVDirection.fx @@ -1,3 +1,4 @@ +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" Texture2D<float4> g_tex2DSliceEndPoints; diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/Sun.fx b/Shaders/PostProcess/EpipolarLightScattering/private/Sun.fx index c53796c..88b94e7 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/Sun.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/Sun.fx @@ -1,3 +1,4 @@ +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" cbuffer cbCameraAttribs diff --git a/Shaders/PostProcess/EpipolarLightScattering/private/UnwarpEpipolarScattering.fx b/Shaders/PostProcess/EpipolarLightScattering/private/UnwarpEpipolarScattering.fx index e97e1fa..8863f13 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/private/UnwarpEpipolarScattering.fx +++ b/Shaders/PostProcess/EpipolarLightScattering/private/UnwarpEpipolarScattering.fx @@ -2,6 +2,7 @@ // Transforms scattering and extinction from epipolar space to camera space and combines with the // back buffer +#include "BasicStructures.fxh" #include "AtmosphereShadersCommon.fxh" cbuffer cbParticipatingMediaScatteringParams diff --git a/Shaders/PostProcess/EpipolarLightScattering/public/Structures.fxh b/Shaders/PostProcess/EpipolarLightScattering/public/EpipolarLightScatteringStructures.fxh index 3a1ff3d..c77ffb2 100644 --- a/Shaders/PostProcess/EpipolarLightScattering/public/Structures.fxh +++ b/Shaders/PostProcess/EpipolarLightScattering/public/EpipolarLightScatteringStructures.fxh @@ -1,23 +1,5 @@ -// This file is derived from the open source project provided by Intel Corportaion that -// requires the following notice to be kept: -//-------------------------------------------------------------------------------------- -// Copyright 2013 Intel Corporation -// All Rights Reserved -// -// Permission is granted to use, copy, distribute and prepare derivative works of this -// software for any purpose and without fee, provided, that the above copyright notice -// and this statement appear in all copies. Intel makes no representations about the -// suitability of this software for any purpose. THIS SOFTWARE IS PROVIDED "AS IS." -// INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, AND ALL LIABILITY, -// INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE, -// INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Intel does not -// assume any responsibility for any errors which may appear in this software nor any -// responsibility to update it. -//-------------------------------------------------------------------------------------- - -#ifndef _STRCUTURES_FXH_ -#define _STRCUTURES_FXH_ +#ifndef _EPIPOLAR_LIGHT_SCATTERING_STRCUTURES_FXH_ +#define _EPIPOLAR_LIGHT_SCATTERING_STRCUTURES_FXH_ #define PI 3.1415928f @@ -60,87 +42,6 @@ #endif -#define MAX_CASCADES 8 -struct CascadeAttribs -{ - float4 f4LightSpaceScale; - float4 f4LightSpaceScaledBias; - float4 f4StartEndZ; -}; -CHECK_STRUCT_ALIGNMENT(CascadeAttribs) - - -struct ShadowMapAttribs -{ - // 0 -#ifdef __cplusplus - float4x4 mWorldToLightViewT; // Matrices in HLSL are COLUMN-major while float4x4 is ROW major -#else - matrix mWorldToLightView; // Transform from view space to light projection space -#endif - // 16 - CascadeAttribs Cascades[MAX_CASCADES]; - -#ifdef __cplusplus - float fCascadeCamSpaceZEnd[MAX_CASCADES]; - float4x4 mWorldToShadowMapUVDepthT[MAX_CASCADES]; -#else - float4 f4CascadeCamSpaceZEnd[MAX_CASCADES/4]; - matrix mWorldToShadowMapUVDepth[MAX_CASCADES]; -#endif - - // Do not use bool, because sizeof(bool)==1 ! - BOOL bVisualizeCascades; - - // float3 f3Padding; - // Stupid OpenGL compiler does not handle 3-component vectors properly - // and screws up the structure layout. - // Opengl.org suggests not using vec3 at all - int Padding0, Padding1, Padding2; -}; -CHECK_STRUCT_ALIGNMENT(ShadowMapAttribs) - - -struct LightAttribs -{ - float4 f4DirOnLight; - float4 f4AmbientLight; - float4 f4LightScreenPos; - float4 f4ExtraterrestrialSunColor; - - BOOL bIsLightOnScreen; - // Stupid OpenGL compiler does not handle 3-component vectors properly - // and screws up the structure layout. - // Opengl.org suggests not using vec3 at all - int Padding0, Padding1, Padding2; - - ShadowMapAttribs ShadowAttribs; -}; -CHECK_STRUCT_ALIGNMENT(LightAttribs) - - -struct CameraAttribs -{ - float4 f4CameraPos; ///< Camera world position - float fNearPlaneZ; - float fFarPlaneZ; // fNearPlaneZ < fFarPlaneZ - float2 f2Dummy; - -#ifdef __cplusplus - float4x4 mViewProjT; - //float4x4 mViewT; - float4x4 mProjT; - float4x4 mViewProjInvT; -#else - matrix mViewProj; - //matrix mView; - matrix mProj; - matrix mViewProjInv; -#endif -}; -CHECK_STRUCT_ALIGNMENT(CameraAttribs) - - #define LIGHT_SCTR_TECHNIQUE_EPIPOLAR_SAMPLING 0 #define LIGHT_SCTR_TECHNIQUE_BRUTE_FORCE 1 @@ -289,4 +190,4 @@ struct MiscDynamicParams }; CHECK_STRUCT_ALIGNMENT(MiscDynamicParams) -#endif //_STRCUTURES_FXH_ +#endif //_EPIPOLAR_LIGHT_SCATTERING_STRCUTURES_FXH_ |
