advancedLightingFeaturesHLSL.h
Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.h
Classes:
class
This is used during the.
class
class
Lights the pixel by sampling from the light deferred buffer.
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _DEFERREDFEATURESHLSL_H_ 25#define _DEFERREDFEATURESHLSL_H_ 26 27#include "shaderGen/HLSL/shaderFeatureHLSL.h" 28#include "shaderGen/HLSL/bumpHLSL.h" 29 30class ConditionerMethodDependency; 31 32 33/// Lights the pixel by sampling from the light deferred 34/// buffer. It will fall back to forward lighting 35/// functionality for non-deferred rendered surfaces. 36/// 37/// Also note that this feature is only used in the 38/// forward rendering pass. It is not used during the 39/// deferred step. 40/// 41class DeferredRTLightingFeatHLSL : public RTLightingFeatHLSL 42{ 43 typedef RTLightingFeatHLSL Parent; 44 45protected: 46 47 /// @see DeferredRTLightingFeatHLSL::processPix() 48 U32 mLastTexIndex; 49 50public: 51 52 virtual void processVert( Vector<ShaderComponent*> &componentList, 53 const MaterialFeatureData &fd ); 54 55 virtual void processPix( Vector<ShaderComponent*> &componentList, 56 const MaterialFeatureData &fd ); 57 58 virtual void processPixMacros( Vector<GFXShaderMacro> ¯os, 59 const MaterialFeatureData &fd ); 60 61 virtual Material::BlendOp getBlendOp(){ return Material::None; } 62 63 virtual Resources getResources( const MaterialFeatureData &fd ); 64 65 virtual void setTexData( Material::StageData &stageDat, 66 const MaterialFeatureData &fd, 67 RenderPassData &passData, 68 U32 &texIndex ); 69 70 virtual String getName() 71 { 72 return "Deferred RT Lighting"; 73 } 74}; 75 76 77/// This is used during the 78class DeferredBumpFeatHLSL : public BumpFeatHLSL 79{ 80 typedef BumpFeatHLSL Parent; 81 82public: 83 virtual void processVert( Vector<ShaderComponent*> &componentList, 84 const MaterialFeatureData &fd ); 85 86 virtual void processPix( Vector<ShaderComponent*> &componentList, 87 const MaterialFeatureData &fd ); 88 89 virtual Material::BlendOp getBlendOp() { return Material::LerpAlpha; } 90 91 virtual Resources getResources( const MaterialFeatureData &fd ); 92 93 virtual void setTexData( Material::StageData &stageDat, 94 const MaterialFeatureData &fd, 95 RenderPassData &passData, 96 U32 &texIndex ); 97 98 virtual String getName() 99 { 100 return "Bumpmap [Deferred]"; 101 } 102}; 103 104 105/// 106class DeferredMinnaertHLSL : public ShaderFeatureHLSL 107{ 108 typedef ShaderFeatureHLSL Parent; 109 110public: 111 virtual void processPix( Vector<ShaderComponent*> &componentList, 112 const MaterialFeatureData &fd ); 113 virtual void processVert( Vector<ShaderComponent*> &componentList, 114 const MaterialFeatureData &fd ); 115 116 virtual void processPixMacros( Vector<GFXShaderMacro> ¯os, 117 const MaterialFeatureData &fd ); 118 119 virtual Resources getResources( const MaterialFeatureData &fd ); 120 121 virtual void setTexData( Material::StageData &stageDat, 122 const MaterialFeatureData &fd, 123 RenderPassData &passData, 124 U32 &texIndex ); 125 126 virtual String getName() 127 { 128 return "Minnaert Shading [Deferred]"; 129 } 130}; 131 132 133/// 134class DeferredSubSurfaceHLSL : public ShaderFeatureHLSL 135{ 136 typedef ShaderFeatureHLSL Parent; 137 138public: 139 virtual void processPix( Vector<ShaderComponent*> &componentList, 140 const MaterialFeatureData &fd ); 141 142 virtual String getName() 143 { 144 return "Sub-Surface Approximation [Deferred]"; 145 } 146}; 147 148#endif // _DEFERREDFEATURESHLSL_H_ 149