advancedLightingFeaturesGLSL.h
Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.h
Classes:
class
This is used during the.
class
class
Generates specular highlights in the forward pass from the light prepass buffer.
class
Lights the pixel by sampling from the light prepass 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 _DEFERREDFEATURESGLSL_H_ 25#define _DEFERREDFEATURESGLSL_H_ 26 27#include "shaderGen/GLSL/shaderFeatureGLSL.h" 28#include "shaderGen/GLSL/bumpGLSL.h" 29#include "shaderGen/GLSL/pixSpecularGLSL.h" 30 31class ConditionerMethodDependency; 32 33 34/// Lights the pixel by sampling from the light prepass 35/// buffer. It will fall back to forward lighting 36/// functionality for non-deferred rendered surfaces. 37/// 38/// Also note that this feature is only used in the 39/// forward rendering pass. It is not used during the 40/// prepass step. 41/// 42class DeferredRTLightingFeatGLSL : public RTLightingFeatGLSL 43{ 44 typedef RTLightingFeatGLSL Parent; 45 46protected: 47 48 /// @see DeferredRTLightingFeatHLSL::processPix() 49 U32 mLastTexIndex; 50 51public: 52 53 virtual void processVert( Vector<ShaderComponent*> &componentList, 54 const MaterialFeatureData &fd ); 55 56 virtual void processPix( Vector<ShaderComponent*> &componentList, 57 const MaterialFeatureData &fd ); 58 59 virtual void processPixMacros( Vector<GFXShaderMacro> ¯os, 60 const MaterialFeatureData &fd ); 61 62 virtual Material::BlendOp getBlendOp(){ return Material::None; } 63 64 virtual Resources getResources( const MaterialFeatureData &fd ); 65 66 virtual void setTexData( Material::StageData &stageDat, 67 const MaterialFeatureData &fd, 68 RenderPassData &passData, 69 U32 &texIndex ); 70 71 virtual String getName() 72 { 73 return "Deferred RT Lighting"; 74 } 75}; 76 77 78/// This is used during the 79class DeferredBumpFeatGLSL : public BumpFeatGLSL 80{ 81 typedef BumpFeatGLSL Parent; 82 83public: 84 virtual void processVert( Vector<ShaderComponent*> &componentList, 85 const MaterialFeatureData &fd ); 86 87 virtual void processPix( Vector<ShaderComponent*> &componentList, 88 const MaterialFeatureData &fd ); 89 90 virtual Material::BlendOp getBlendOp() { return Material::LerpAlpha; } 91 92 virtual Resources getResources( const MaterialFeatureData &fd ); 93 94 virtual void setTexData( Material::StageData &stageDat, 95 const MaterialFeatureData &fd, 96 RenderPassData &passData, 97 U32 &texIndex ); 98 99 virtual String getName() 100 { 101 return "Bumpmap [Deferred]"; 102 } 103}; 104 105 106/// Generates specular highlights in the forward pass 107/// from the light prepass buffer. 108class DeferredPixelSpecularGLSL : public PixelSpecularGLSL 109{ 110 typedef PixelSpecularGLSL Parent; 111 112public: 113 virtual void processVert( Vector<ShaderComponent*> &componentList, 114 const MaterialFeatureData &fd ); 115 116 virtual void processPix( Vector<ShaderComponent*> &componentList, 117 const MaterialFeatureData &fd ); 118 119 virtual Resources getResources( const MaterialFeatureData &fd ); 120 121 virtual String getName() 122 { 123 return "Pixel Specular [Deferred]"; 124 } 125}; 126 127 128/// 129class DeferredMinnaertGLSL : public ShaderFeatureGLSL 130{ 131 typedef ShaderFeatureGLSL Parent; 132 133public: 134 virtual void processPix( Vector<ShaderComponent*> &componentList, 135 const MaterialFeatureData &fd ); 136 virtual void processVert( Vector<ShaderComponent*> &componentList, 137 const MaterialFeatureData &fd ); 138 139 virtual void processPixMacros( Vector<GFXShaderMacro> ¯os, 140 const MaterialFeatureData &fd ); 141 142 virtual Resources getResources( const MaterialFeatureData &fd ); 143 144 virtual void setTexData( Material::StageData &stageDat, 145 const MaterialFeatureData &fd, 146 RenderPassData &passData, 147 U32 &texIndex ); 148 149 virtual String getName() 150 { 151 return "Minnaert Shading [Deferred]"; 152 } 153}; 154 155 156/// 157class DeferredSubSurfaceGLSL : public ShaderFeatureGLSL 158{ 159 typedef ShaderFeatureGLSL Parent; 160 161public: 162 virtual void processPix( Vector<ShaderComponent*> &componentList, 163 const MaterialFeatureData &fd ); 164 165 virtual String getName() 166 { 167 return "Sub-Surface Approximation [Deferred]"; 168 } 169}; 170 171#endif // _DEFERREDFEATURESGLSL_H_ 172
