materialFeatureData.h
Engine/source/materials/materialFeatureData.h
Classes:
class
Public Typedefs
Delegate< void(ProcessedMaterial *mat, U32 stageNum, MaterialFeatureData &fd, const FeatureSet &features) >
MatFeaturesDelegate
Detailed Description
Public Typedefs
typedef Delegate< void(ProcessedMaterial *mat, U32 stageNum, MaterialFeatureData &fd, const FeatureSet &features) > MatFeaturesDelegate
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 _MATERIALFEATUREDATA_H_ 25#define _MATERIALFEATUREDATA_H_ 26 27#ifndef _UTIL_DELEGATE_H_ 28#include "core/util/delegate.h" 29#endif 30#ifndef _FEATURESET_H_ 31#include "shaderGen/featureSet.h" 32#endif 33 34 35class ProcessedMaterial; 36 37 38//----------------------------------------------------------------------------- 39// MaterialFeatureData, this is basically a series of flags which a material can 40// ask for. Shader processed materials will use the shadergen system to accomplish this, 41// FF processed materials will do the best they can. 42//----------------------------------------------------------------------------- 43struct MaterialFeatureData 44{ 45public: 46 47 // General feature data for a pass or for other purposes. 48 FeatureSet features; 49 50 // This is to give hints to shader creation code. It contains 51 // all the features that are in a material stage instead of just 52 // the current pass. 53 FeatureSet materialFeatures; 54 55public: 56 57 MaterialFeatureData(); 58 59 MaterialFeatureData( const MaterialFeatureData &data ); 60 61 MaterialFeatureData( const FeatureSet &handle ); 62 63 void clear(); 64 65 const FeatureSet& codify() const { return features; } 66 67}; 68 69 70/// 71typedef Delegate< void( ProcessedMaterial *mat, 72 U32 stageNum, 73 MaterialFeatureData &fd, 74 const FeatureSet &features) > MatFeaturesDelegate; 75 76#endif // _MATERIALFEATUREDATA_H_ 77