mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Implement a global shader parameter passing system and useful shaders
This commit is contained in:
17
src/shader.h
17
src/shader.h
@@ -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);
|
||||
|
Reference in New Issue
Block a user