Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
IShaderSource Class Referenceabstract

#include <shader.h>

+ Inheritance diagram for IShaderSource:

Public Member Functions

 IShaderSource ()=default
 
virtual ~IShaderSource ()=default
 
virtual const ShaderInfogetShaderInfo (u32 id)=0
 returns information about an existing shader
 
virtual u32 getShader (const std::string &name, const ShaderConstants &input_const, video::E_MATERIAL_TYPE base_mat, IShaderUniformSetterRC *setter_cb=nullptr)=0
 Generates or gets a shader.
 
u32 getShader (const std::string &name, MaterialType material_type, NodeDrawType drawtype=NDT_NORMAL, bool array_texture=false)
 Helper: Generates or gets a shader suitable for nodes and entities.
 
u32 getShaderRaw (const std::string &name, bool blendAlpha=false)
 Helper: Generates or gets a shader for common, general use.
 
virtual bool supportsSampler2DArray () const =0
 Returns true if 'sampler2DArray' is supported in GLSL.
 

Constructor & Destructor Documentation

◆ IShaderSource()

IShaderSource::IShaderSource ( )
default

◆ ~IShaderSource()

virtual IShaderSource::~IShaderSource ( )
virtualdefault

Member Function Documentation

◆ getShader() [1/2]

virtual u32 IShaderSource::getShader ( const std::string & name,
const ShaderConstants & input_const,
video::E_MATERIAL_TYPE base_mat,
IShaderUniformSetterRC * setter_cb = nullptr )
pure virtual

Generates or gets a shader.

Note that the input constants are not for passing the entire world into the shader. Use IShaderConstantSetter to handle user settings.

Parameters
namename of the shader (directory on disk)
input_constprimary key constants for this shader
base_matbase material to use
setter_cbadditional uniform setter to use
Returns
shader ID
Note
base_material only controls alpha behavior

Implemented in ShaderSource.

Referenced by GenericCAO::addToScene(), getAdHocNodeShader(), getShaderRaw(), WieldMeshSceneNode::setItem(), and NodeVisuals::updateTextures().

+ Here is the caller graph for this function:

◆ getShader() [2/2]

u32 IShaderSource::getShader ( const std::string & name,
MaterialType material_type,
NodeDrawType drawtype = NDT_NORMAL,
bool array_texture = false )

Helper: Generates or gets a shader suitable for nodes and entities.

◆ getShaderInfo()

virtual const ShaderInfo & IShaderSource::getShaderInfo ( u32 id)
pure virtual

returns information about an existing shader

Use this to get the material ID to plug into video::SMaterial.

Implemented in ShaderSource.

Referenced by Clouds::Clouds(), Hud::Hud(), MapBlockMesh::MapBlockMesh(), Sky::Sky(), GenericCAO::addToScene(), Minimap::drawMinimap(), getAdHocNodeShader(), PostProcessingStep::run(), and WieldMeshSceneNode::setItem().

+ Here is the caller graph for this function:

◆ getShaderRaw()

u32 IShaderSource::getShaderRaw ( const std::string & name,
bool blendAlpha = false )
inline

Helper: Generates or gets a shader for common, general use.

Parameters
namename of the shader
blendAlphaenable alpha blending for this material?
Returns
shader ID

References getShader().

Referenced by Clouds::Clouds(), Hud::Hud(), Sky::Sky(), and Minimap::drawMinimap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ supportsSampler2DArray()

virtual bool IShaderSource::supportsSampler2DArray ( ) const
pure virtual

Returns true if 'sampler2DArray' is supported in GLSL.

Implemented in ShaderSource.

Referenced by getArrayTextureMax().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: