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:
parent
22e6fb7056
commit
27373919f4
15 changed files with 241 additions and 90 deletions
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue