Torque3D Documentation / _generateds / advancedLightingFeaturesGLSL.h

advancedLightingFeaturesGLSL.h

Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.h

More...

Classes:

class

This is used during the.

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 _DEFERREDFEATURESGLSL_H_
 25#define _DEFERREDFEATURESGLSL_H_
 26
 27#include "shaderGen/GLSL/shaderFeatureGLSL.h"
 28#include "shaderGen/GLSL/bumpGLSL.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 DeferredRTLightingFeatGLSL : public RTLightingFeatGLSL
 42{
 43   typedef RTLightingFeatGLSL 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> &macros, 
 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 DeferredBumpFeatGLSL : public BumpFeatGLSL
 79{
 80   typedef BumpFeatGLSL 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///
105class DeferredMinnaertGLSL : public ShaderFeatureGLSL
106{
107   typedef ShaderFeatureGLSL Parent;
108   
109public:
110   virtual void processPix(   Vector<ShaderComponent*> &componentList, 
111                              const MaterialFeatureData &fd );
112   virtual void processVert(  Vector<ShaderComponent*> &componentList,
113                              const MaterialFeatureData &fd );
114
115   virtual void processPixMacros(   Vector<GFXShaderMacro> &macros, 
116                                    const MaterialFeatureData &fd );
117
118   virtual Resources getResources( const MaterialFeatureData &fd );
119
120   virtual void setTexData(   Material::StageData &stageDat,
121                              const MaterialFeatureData &fd,
122                              RenderPassData &passData,
123                              U32 &texIndex );
124
125   virtual String getName()
126   {
127      return "Minnaert Shading [Deferred]";
128   }
129};
130
131
132///
133class DeferredSubSurfaceGLSL : public ShaderFeatureGLSL
134{
135   typedef ShaderFeatureGLSL Parent;
136
137public:
138   virtual void processPix(   Vector<ShaderComponent*> &componentList, 
139                              const MaterialFeatureData &fd );
140
141   virtual String getName()
142   {
143      return "Sub-Surface Approximation [Deferred]";
144   }
145};
146
147#endif // _DEFERREDFEATURESGLSL_H_
148