shaderGenHLSLInit.cpp
Engine/source/shaderGen/HLSL/shaderGenHLSLInit.cpp
Public Variables
Public Functions
_initShaderGenHLSL(ShaderGen * shaderGen)
registerInitDelegate(Direct3D11 , sInitDelegate )
Detailed Description
Public Variables
MODULE_END
MODULE_INIT
ShaderGen::ShaderGenInitDelegate sInitDelegate
Public Functions
_initShaderGenHLSL(ShaderGen * shaderGen)
registerInitDelegate(Direct3D11 , sInitDelegate )
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#include "platform/platform.h" 25 26#include "shaderGen/shaderGen.h" 27#include "shaderGen/HLSL/shaderGenHLSL.h" 28#include "shaderGen/HLSL/shaderFeatureHLSL.h" 29#include "shaderGen/featureMgr.h" 30#include "shaderGen/HLSL/bumpHLSL.h" 31#include "shaderGen/HLSL/depthHLSL.h" 32#include "shaderGen/HLSL/debugVizFeatureHLSL.h" 33#include "shaderGen/HLSL/paraboloidHLSL.h" 34#include "materials/materialFeatureTypes.h" 35#include "core/module.h" 36// Deferred Shading 37#include "lighting/advanced/hlsl/deferredShadingFeaturesHLSL.h" 38#include "shaderGen/HLSL/accuFeatureHLSL.h" 39 40static ShaderGen::ShaderGenInitDelegate sInitDelegate; 41 42void _initShaderGenHLSL( ShaderGen *shaderGen ) 43{ 44 shaderGen->setPrinter( new ShaderGenPrinterHLSL ); 45 shaderGen->setComponentFactory( new ShaderGenComponentFactoryHLSL ); 46 shaderGen->setFileEnding( "hlsl" ); 47 48 FEATUREMGR->registerFeature( MFT_VertTransform, new VertPositionHLSL ); 49 FEATUREMGR->registerFeature( MFT_RTLighting, new RTLightingFeatHLSL ); 50 FEATUREMGR->registerFeature( MFT_IsBC3nm, new NamedFeatureHLSL( "BC3nm" ) ); 51 FEATUREMGR->registerFeature( MFT_IsBC5nm, new NamedFeatureHLSL( "BC5nm" ) ); 52 FEATUREMGR->registerFeature( MFT_TexAnim, new TexAnimHLSL ); 53 FEATUREMGR->registerFeature( MFT_DiffuseMap, new DiffuseMapFeatHLSL ); 54 FEATUREMGR->registerFeature( MFT_OverlayMap, new OverlayTexFeatHLSL ); 55 FEATUREMGR->registerFeature( MFT_DiffuseColor, new DiffuseFeatureHLSL ); 56 FEATUREMGR->registerFeature( MFT_DiffuseVertColor, new DiffuseVertColorFeatureHLSL ); 57 FEATUREMGR->registerFeature( MFT_AlphaTest, new AlphaTestHLSL ); 58 FEATUREMGR->registerFeature( MFT_GlowMask, new GlowMaskHLSL ); 59 FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatHLSL ); 60 FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatHLSL ); 61 FEATUREMGR->registerFeature( MFT_VertLit, new VertLitHLSL ); 62 FEATUREMGR->registerFeature( MFT_Parallax, new ParallaxFeatHLSL ); 63 FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatHLSL ); 64 FEATUREMGR->registerFeature( MFT_DetailNormalMap, new NamedFeatureHLSL( "Detail Normal Map" ) ); 65 FEATUREMGR->registerFeature( MFT_DetailMap, new DetailFeatHLSL ); 66 FEATUREMGR->registerFeature( MFT_StaticCubemap, new NamedFeatureHLSL( "Static Cubemap" ) ); 67 FEATUREMGR->registerFeature( MFT_CubeMap, new ReflectCubeFeatHLSL ); 68 FEATUREMGR->registerFeature( MFT_ReflectionProbes, new ReflectionProbeFeatHLSL); 69 FEATUREMGR->registerFeature( MFT_InvertRoughness, new NamedFeatureHLSL( "Roughest = 1.0" ) ); 70 FEATUREMGR->registerFeature( MFT_IsTranslucent, new NamedFeatureHLSL( "Translucent" ) ); 71 FEATUREMGR->registerFeature( MFT_IsTranslucentZWrite, new NamedFeatureHLSL( "Translucent ZWrite" ) ); 72 FEATUREMGR->registerFeature( MFT_Visibility, new VisibilityFeatHLSL ); 73 FEATUREMGR->registerFeature( MFT_Fog, new FogFeatHLSL ); 74 FEATUREMGR->registerFeature( MFT_AccuMap, new AccuTexFeatHLSL ); 75 FEATUREMGR->registerFeature( MFT_LightbufferMRT, new NamedFeatureHLSL( "Lightbuffer MRT" ) ); 76 FEATUREMGR->registerFeature( MFT_RenderTarget1_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget1 ) ); 77 FEATUREMGR->registerFeature( MFT_RenderTarget2_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget2 ) ); 78 FEATUREMGR->registerFeature( MFT_RenderTarget3_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget3 ) ); 79 FEATUREMGR->registerFeature( MFT_Imposter, new NamedFeatureHLSL( "Imposter" ) ); 80 81 FEATUREMGR->registerFeature( MFT_DiffuseMapAtlas, new NamedFeatureHLSL( "Diffuse Map Atlas" ) ); 82 FEATUREMGR->registerFeature( MFT_NormalMapAtlas, new NamedFeatureHLSL( "Normal Map Atlas" ) ); 83 84 FEATUREMGR->registerFeature( MFT_NormalsOut, new NormalsOutFeatHLSL ); 85 86 FEATUREMGR->registerFeature( MFT_DepthOut, new DepthOutHLSL ); 87 FEATUREMGR->registerFeature( MFT_EyeSpaceDepthOut, new EyeSpaceDepthOutHLSL() ); 88 89 FEATUREMGR->registerFeature( MFT_HDROut, new HDROutHLSL ); 90 91 FEATUREMGR->registerFeature( MFT_DebugViz, new DebugVizHLSL); 92 93 FEATUREMGR->registerFeature( MFT_ParaboloidVertTransform, new ParaboloidVertTransformHLSL ); 94 FEATUREMGR->registerFeature( MFT_IsSinglePassParaboloid, new NamedFeatureHLSL( "Single Pass Paraboloid" ) ); 95 FEATUREMGR->registerFeature( MFT_UseInstancing, new NamedFeatureHLSL( "Hardware Instancing" ) ); 96 97 FEATUREMGR->registerFeature( MFT_Foliage, new FoliageFeatureHLSL ); 98 99 FEATUREMGR->registerFeature( MFT_ParticleNormal, new ParticleNormalFeatureHLSL ); 100 101 FEATUREMGR->registerFeature( MFT_ForwardShading, new NamedFeatureHLSL( "Forward Shaded Material" ) ); 102 103 FEATUREMGR->registerFeature( MFT_ImposterVert, new ImposterVertFeatureHLSL ); 104 105 FEATUREMGR->registerFeature( MFT_isDeferred, new NamedFeatureHLSL( "Deferred Material" ) ); 106 FEATUREMGR->registerFeature( MFT_OrmMap, new DeferredOrmMapHLSL); 107 FEATUREMGR->registerFeature( MFT_ORMConfigVars, new ORMConfigVarsHLSL); 108 FEATUREMGR->registerFeature( MFT_MatInfoFlags, new MatInfoFlagsHLSL ); 109 FEATUREMGR->registerFeature( MFT_GlowMap, new GlowMapHLSL); 110 FEATUREMGR->registerFeature( MFT_isBackground, new NamedFeatureHLSL("Background Object")); 111 FEATUREMGR->registerFeature( MFT_SkyBox, new NamedFeatureHLSL( "skybox" ) ); 112 FEATUREMGR->registerFeature( MFT_HardwareSkinning, new HardwareSkinningFeatureHLSL ); 113} 114 115MODULE_BEGIN( ShaderGenHLSL ) 116 117 MODULE_INIT_AFTER( ShaderGen ) 118 MODULE_INIT_AFTER( ShaderGenFeatureMgr ) 119 120 MODULE_INIT 121 { 122 sInitDelegate.bind(_initShaderGenHLSL); 123 SHADERGEN->registerInitDelegate(Direct3D11, sInitDelegate); 124 } 125 126MODULE_END; 127