Initial implementation of Custom Shader Features.

This commit is contained in:
Areloch 2017-10-05 17:04:51 -05:00
parent f9b7f66571
commit dc5e502dec
12 changed files with 595 additions and 9 deletions

View file

@ -47,6 +47,10 @@
#include "materials/materialFeatureData.h"
#endif
#ifndef CUSTOMSHADERFEATURE_H
#include "shadergen/customShaderFeature.h"
#endif
/// Base class used by shaderGen to be API agnostic. Subclasses implement the various methods
/// in an API specific way.
class ShaderGenPrinter
@ -151,10 +155,11 @@ public:
F32 *pixVersion,
const GFXVertexFormat *vertexFormat,
const char* cacheName,
Vector<GFXShaderMacro> &macros );
Vector<GFXShaderMacro> &macros,
Vector<CustomShaderFeatureData*> &customFeatureData);
// Returns a shader that implements the features listed by dat.
GFXShader* getShader( const MaterialFeatureData &dat, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers );
GFXShader* getShader( const MaterialFeatureData &dat, Vector<CustomShaderFeatureData*> &customFeatureData, const GFXVertexFormat *vertexFormat, const Vector<GFXShaderMacro> *macros, const Vector<String> &samplers );
// This will delete all of the procedural shaders that we have. Used to regenerate shaders when
// the ShaderFeatures have changed (due to lighting system change, or new plugin)
@ -176,6 +181,8 @@ protected:
Vector< ShaderComponent *> mComponents;
Vector< CustomShaderFeatureData* > mCustomFeaturesData;
AutoPtr<ShaderGenPrinter> mPrinter;
AutoPtr<ShaderGenComponentFactory> mComponentFactory;