1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Implement a global shader parameter passing system and useful shaders

This commit is contained in:
Perttu Ahola 2012-12-01 03:02:16 +02:00
parent 22e6fb7056
commit 27373919f4
15 changed files with 241 additions and 90 deletions

View file

@ -51,6 +51,22 @@ struct ShaderInfo
ShaderInfo(): name(""), material(video::EMT_SOLID) {}
};
/*
Setter of constants for shaders
*/
namespace irr { namespace video {
class IMaterialRendererServices;
} }
class IShaderConstantSetter
{
public:
virtual ~IShaderConstantSetter(){};
virtual void onSetConstants(video::IMaterialRendererServices *services,
bool is_highlevel) = 0;
};
/*
ShaderSource creates and caches shaders.
*/
@ -82,6 +98,7 @@ public:
virtual void insertSourceShader(const std::string &name_of_shader,
const std::string &filename, const std::string &program)=0;
virtual void rebuildShaders()=0;
virtual void addGlobalConstantSetter(IShaderConstantSetter *setter)=0;
};
IWritableShaderSource* createShaderSource(IrrlichtDevice *device);