arsa  2.7
Public Member Functions | List of all members
irr::video::IGPUProgrammingServices Class Referenceabstract

Interface making it possible to create and use programs running on the GPU. More...

#include <IGPUProgrammingServices.h>

Public Member Functions

virtual ~IGPUProgrammingServices ()
 Destructor. More...
 
virtual s32 addHighLevelShaderMaterial (const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const c8 *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const c8 *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Adds a new high-level shading material renderer to the VideoDriver. More...
 
s32 addHighLevelShaderMaterial (const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, const c8 *pixelShaderProgram=0, const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use without geometry shaders More...
 
s32 addHighLevelShaderMaterial (const c8 *vertexShaderProgram, const c8 *pixelShaderProgram=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use with many defaults, without geometry shader More...
 
s32 addHighLevelShaderMaterial (const c8 *vertexShaderProgram, const c8 *pixelShaderProgram=0, const c8 *geometryShaderProgram=0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use with many defaults, with geometry shader More...
 
virtual s32 addHighLevelShaderMaterialFromFiles (const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. More...
 
s32 addHighLevelShaderMaterialFromFiles (const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, const io::path &pixelShaderProgramFileName="", const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use without geometry shaders More...
 
s32 addHighLevelShaderMaterialFromFiles (const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName="", IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use with many defaults, without geometry shader More...
 
s32 addHighLevelShaderMaterialFromFiles (const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName="", const io::path &geometryShaderProgramFileName="", scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use with many defaults, with geometry shader More...
 
virtual s32 addHighLevelShaderMaterialFromFiles (io::IReadFile *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, io::IReadFile *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, io::IReadFile *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. More...
 
s32 addHighLevelShaderMaterialFromFiles (io::IReadFile *vertexShaderProgram, const c8 *vertexShaderEntryPointName="main", E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, io::IReadFile *pixelShaderProgram=0, const c8 *pixelShaderEntryPointName="main", E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)
 convenience function for use without geometry shaders More...
 
virtual s32 addShaderMaterial (const c8 *vertexShaderProgram=0, const c8 *pixelShaderProgram=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Adds a new ASM shader material renderer to the VideoDriver. More...
 
virtual s32 addShaderMaterialFromFiles (io::IReadFile *vertexShaderProgram, io::IReadFile *pixelShaderProgram, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. More...
 
virtual s32 addShaderMaterialFromFiles (const io::path &vertexShaderProgramFileName, const io::path &pixelShaderProgramFileName, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
 Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. More...
 

Detailed Description

Interface making it possible to create and use programs running on the GPU.

Definition at line 28 of file IGPUProgrammingServices.h.

Constructor & Destructor Documentation

◆ ~IGPUProgrammingServices()

virtual irr::video::IGPUProgrammingServices::~IGPUProgrammingServices ( )
inlinevirtual

Destructor.

Definition at line 33 of file IGPUProgrammingServices.h.

33 {}

Member Function Documentation

◆ addHighLevelShaderMaterial() [1/4]

virtual s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterial ( const c8 vertexShaderProgram,
const c8 vertexShaderEntryPointName,
E_VERTEX_SHADER_TYPE  vsCompileTarget,
const c8 pixelShaderProgram,
const c8 pixelShaderEntryPointName,
E_PIXEL_SHADER_TYPE  psCompileTarget,
const c8 geometryShaderProgram,
const c8 geometryShaderEntryPointName = "main",
E_GEOMETRY_SHADER_TYPE  gsCompileTarget = EGST_GS_4_0,
scene::E_PRIMITIVE_TYPE  inType = scene::EPT_TRIANGLES,
scene::E_PRIMITIVE_TYPE  outType = scene::EPT_TRIANGLE_STRIP,
u32  verticesOut = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Adds a new high-level shading material renderer to the VideoDriver.

Currently only HLSL/D3D9 and GLSL/OpenGL are supported.

Parameters
vertexShaderProgramString containing the source of the vertex shader program. This can be 0 if no vertex program shall be used.
vertexShaderEntryPointNameName of the entry function of the vertexShaderProgram (p.e. "main")
vsCompileTargetVertex shader version the high level shader shall be compiled to.
pixelShaderProgramString containing the source of the pixel shader program. This can be 0 if no pixel shader shall be used.
pixelShaderEntryPointNameEntry name of the function of the pixelShaderProgram (p.e. "main")
psCompileTargetPixel shader version the high level shader shall be compiled to.
geometryShaderProgramString containing the source of the geometry shader program. This can be 0 if no geometry shader shall be used.
geometryShaderEntryPointNameEntry name of the function of the geometryShaderProgram (p.e. "main")
gsCompileTargetGeometry shader version the high level shader shall be compiled to.
inTypeType of vertices passed to geometry shader
outTypeType of vertices created by geometry shader
verticesOutMaximal number of vertices created by geometry shader. If 0, maximal number supported is assumed.
callbackPointer to an implementation of IShaderConstantSetCallBack in which you can set the needed vertex, pixel, and geometry shader program constants. Set this to 0 if you don't need this.
baseMaterialBase material which renderstates will be used to shade the material.
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred, e.g. if a shader program could not be compiled or a compile target is not reachable. The error strings are then printed to the error log and can be caught with a custom event receiver.

◆ addHighLevelShaderMaterial() [2/4]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterial ( const c8 vertexShaderProgram,
const c8 vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE  vsCompileTarget = EVST_VS_1_1,
const c8 pixelShaderProgram = 0,
const c8 pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE  psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use without geometry shaders

Definition at line 94 of file IGPUProgrammingServices.h.

104  {
106  vertexShaderProgram, vertexShaderEntryPointName,
107  vsCompileTarget, pixelShaderProgram,
108  pixelShaderEntryPointName, psCompileTarget,
109  0, "main", EGST_GS_4_0,
111  callback, baseMaterial, userData);
112  }
Explicitly set all vertices for each triangle.
virtual s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const c8 *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const c8 *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Adds a new high-level shading material renderer to the VideoDriver.

◆ addHighLevelShaderMaterial() [3/4]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterial ( const c8 vertexShaderProgram,
const c8 pixelShaderProgram = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use with many defaults, without geometry shader

All shader names are set to "main" and compile targets are shader type 1.1.

Definition at line 118 of file IGPUProgrammingServices.h.

124  {
126  vertexShaderProgram, "main",
127  EVST_VS_1_1, pixelShaderProgram,
128  "main", EPST_PS_1_1,
129  0, "main", EGST_GS_4_0,
131  callback, baseMaterial, userData);
132  }
Explicitly set all vertices for each triangle.
virtual s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const c8 *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const c8 *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Adds a new high-level shading material renderer to the VideoDriver.

◆ addHighLevelShaderMaterial() [4/4]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterial ( const c8 vertexShaderProgram,
const c8 pixelShaderProgram = 0,
const c8 geometryShaderProgram = 0,
scene::E_PRIMITIVE_TYPE  inType = scene::EPT_TRIANGLES,
scene::E_PRIMITIVE_TYPE  outType = scene::EPT_TRIANGLE_STRIP,
u32  verticesOut = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use with many defaults, with geometry shader

All shader names are set to "main" and compile targets are shader type 1.1 and geometry shader 4.0.

Definition at line 138 of file IGPUProgrammingServices.h.

148  {
150  vertexShaderProgram, "main",
151  EVST_VS_1_1, pixelShaderProgram,
152  "main", EPST_PS_1_1,
153  geometryShaderProgram, "main", EGST_GS_4_0,
154  inType, outType, verticesOut,
155  callback, baseMaterial, userData);
156  }
virtual s32 addHighLevelShaderMaterial(const c8 *vertexShaderProgram, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const c8 *pixelShaderProgram, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const c8 *geometryShaderProgram, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Adds a new high-level shading material renderer to the VideoDriver.

◆ addHighLevelShaderMaterialFromFiles() [1/6]

virtual s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( const io::path vertexShaderProgramFileName,
const c8 vertexShaderEntryPointName,
E_VERTEX_SHADER_TYPE  vsCompileTarget,
const io::path pixelShaderProgramFileName,
const c8 pixelShaderEntryPointName,
E_PIXEL_SHADER_TYPE  psCompileTarget,
const io::path geometryShaderProgramFileName,
const c8 geometryShaderEntryPointName = "main",
E_GEOMETRY_SHADER_TYPE  gsCompileTarget = EGST_GS_4_0,
scene::E_PRIMITIVE_TYPE  inType = scene::EPT_TRIANGLES,
scene::E_PRIMITIVE_TYPE  outType = scene::EPT_TRIANGLE_STRIP,
u32  verticesOut = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

Parameters
vertexShaderProgramFileNameText file containing the source of the vertex shader program. Set to empty string if no vertex shader shall be created.
vertexShaderEntryPointNameName of the entry function of the vertexShaderProgram (p.e. "main")
vsCompileTargetVertex shader version the high level shader shall be compiled to.
pixelShaderProgramFileNameText file containing the source of the pixel shader program. Set to empty string if no pixel shader shall be created.
pixelShaderEntryPointNameEntry name of the function of the pixelShaderProgram (p.e. "main")
psCompileTargetPixel shader version the high level shader shall be compiled to.
geometryShaderProgramFileNameName of the source of the geometry shader program. Set to empty string if no geometry shader shall be created.
geometryShaderEntryPointNameEntry name of the function of the geometryShaderProgram (p.e. "main")
gsCompileTargetGeometry shader version the high level shader shall be compiled to.
inTypeType of vertices passed to geometry shader
outTypeType of vertices created by geometry shader
verticesOutMaximal number of vertices created by geometry shader. If 0, maximal number supported is assumed.
callbackPointer to an implementation of IShaderConstantSetCallBack in which you can set the needed vertex, pixel, and geometry shader program constants. Set this to 0 if you don't need this.
baseMaterialBase material which renderstates will be used to shade the material.
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred, e.g. if a shader program could not be compiled or a compile target is not reachable. The error strings are then printed to the error log and can be caught with a custom event receiver.

◆ addHighLevelShaderMaterialFromFiles() [2/6]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( const io::path vertexShaderProgramFileName,
const c8 vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE  vsCompileTarget = EVST_VS_1_1,
const io::path pixelShaderProgramFileName = "",
const c8 pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE  psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use without geometry shaders

Definition at line 218 of file IGPUProgrammingServices.h.

228  {
230  vertexShaderProgramFileName, vertexShaderEntryPointName,
231  vsCompileTarget, pixelShaderProgramFileName,
232  pixelShaderEntryPointName, psCompileTarget,
233  "", "main", EGST_GS_4_0,
235  callback, baseMaterial, userData);
236  }
Explicitly set all vertices for each triangle.
virtual s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

◆ addHighLevelShaderMaterialFromFiles() [3/6]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( const io::path vertexShaderProgramFileName,
const io::path pixelShaderProgramFileName = "",
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use with many defaults, without geometry shader

All shader names are set to "main" and compile targets are shader type 1.1.

Definition at line 242 of file IGPUProgrammingServices.h.

248  {
250  vertexShaderProgramFileName, "main",
251  EVST_VS_1_1, pixelShaderProgramFileName,
252  "main", EPST_PS_1_1,
253  "", "main", EGST_GS_4_0,
255  callback, baseMaterial, userData);
256  }
Explicitly set all vertices for each triangle.
virtual s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

◆ addHighLevelShaderMaterialFromFiles() [4/6]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( const io::path vertexShaderProgramFileName,
const io::path pixelShaderProgramFileName = "",
const io::path geometryShaderProgramFileName = "",
scene::E_PRIMITIVE_TYPE  inType = scene::EPT_TRIANGLES,
scene::E_PRIMITIVE_TYPE  outType = scene::EPT_TRIANGLE_STRIP,
u32  verticesOut = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use with many defaults, with geometry shader

All shader names are set to "main" and compile targets are shader type 1.1 and geometry shader 4.0.

Definition at line 262 of file IGPUProgrammingServices.h.

272  {
274  vertexShaderProgramFileName, "main",
275  EVST_VS_1_1, pixelShaderProgramFileName,
276  "main", EPST_PS_1_1,
277  geometryShaderProgramFileName, "main", EGST_GS_4_0,
278  inType, outType, verticesOut,
279  callback, baseMaterial, userData);
280  }
virtual s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

◆ addHighLevelShaderMaterialFromFiles() [5/6]

virtual s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( io::IReadFile vertexShaderProgram,
const c8 vertexShaderEntryPointName,
E_VERTEX_SHADER_TYPE  vsCompileTarget,
io::IReadFile pixelShaderProgram,
const c8 pixelShaderEntryPointName,
E_PIXEL_SHADER_TYPE  psCompileTarget,
io::IReadFile geometryShaderProgram,
const c8 geometryShaderEntryPointName = "main",
E_GEOMETRY_SHADER_TYPE  gsCompileTarget = EGST_GS_4_0,
scene::E_PRIMITIVE_TYPE  inType = scene::EPT_TRIANGLES,
scene::E_PRIMITIVE_TYPE  outType = scene::EPT_TRIANGLE_STRIP,
u32  verticesOut = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

Parameters
vertexShaderProgramText file handle containing the source of the vertex shader program. Set to 0 if no vertex shader shall be created.
vertexShaderEntryPointNameName of the entry function of the vertexShaderProgram
vsCompileTargetVertex shader version the high level shader shall be compiled to.
pixelShaderProgramText file handle containing the source of the pixel shader program. Set to 0 if no pixel shader shall be created.
pixelShaderEntryPointNameEntry name of the function of the pixelShaderProgram (p.e. "main")
psCompileTargetPixel shader version the high level shader shall be compiled to.
geometryShaderProgramText file handle containing the source of the geometry shader program. Set to 0 if no geometry shader shall be created.
geometryShaderEntryPointNameEntry name of the function of the geometryShaderProgram (p.e. "main")
gsCompileTargetGeometry shader version the high level shader shall be compiled to.
inTypeType of vertices passed to geometry shader
outTypeType of vertices created by geometry shader
verticesOutMaximal number of vertices created by geometry shader. If 0, maximal number supported is assumed.
callbackPointer to an implementation of IShaderConstantSetCallBack in which you can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
baseMaterialBase material which renderstates will be used to shade the material.
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred, e.g. if a shader program could not be compiled or a compile target is not reachable. The error strings are then printed to the error log and can be caught with a custom event receiver.

◆ addHighLevelShaderMaterialFromFiles() [6/6]

s32 irr::video::IGPUProgrammingServices::addHighLevelShaderMaterialFromFiles ( io::IReadFile vertexShaderProgram,
const c8 vertexShaderEntryPointName = "main",
E_VERTEX_SHADER_TYPE  vsCompileTarget = EVST_VS_1_1,
io::IReadFile pixelShaderProgram = 0,
const c8 pixelShaderEntryPointName = "main",
E_PIXEL_SHADER_TYPE  psCompileTarget = EPST_PS_1_1,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
inline

convenience function for use without geometry shaders

Definition at line 340 of file IGPUProgrammingServices.h.

350  {
352  vertexShaderProgram, vertexShaderEntryPointName,
353  vsCompileTarget, pixelShaderProgram,
354  pixelShaderEntryPointName, psCompileTarget,
355  0, "main", EGST_GS_4_0,
357  callback, baseMaterial, userData);
358  }
Explicitly set all vertices for each triangle.
virtual s32 addHighLevelShaderMaterialFromFiles(const io::path &vertexShaderProgramFileName, const c8 *vertexShaderEntryPointName, E_VERTEX_SHADER_TYPE vsCompileTarget, const io::path &pixelShaderProgramFileName, const c8 *pixelShaderEntryPointName, E_PIXEL_SHADER_TYPE psCompileTarget, const io::path &geometryShaderProgramFileName, const c8 *geometryShaderEntryPointName="main", E_GEOMETRY_SHADER_TYPE gsCompileTarget=EGST_GS_4_0, scene::E_PRIMITIVE_TYPE inType=scene::EPT_TRIANGLES, scene::E_PRIMITIVE_TYPE outType=scene::EPT_TRIANGLE_STRIP, u32 verticesOut=0, IShaderConstantSetCallBack *callback=0, E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, s32 userData=0)=0
Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

◆ addShaderMaterial()

virtual s32 irr::video::IGPUProgrammingServices::addShaderMaterial ( const c8 vertexShaderProgram = 0,
const c8 pixelShaderProgram = 0,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Adds a new ASM shader material renderer to the VideoDriver.

Note that it is a good idea to call IVideoDriver::queryFeature() in advance to check if the IVideoDriver supports the vertex and/or pixel shader version your are using.

The material is added to the VideoDriver like with IVideoDriver::addMaterialRenderer() and can be used like it had been added with that method.

Parameters
vertexShaderProgramString containing the source of the vertex shader program. This can be 0 if no vertex program shall be used.

For DX8 programs, the will always input registers look like this: v0: position, v1: normal, v2: color, v3: texture coordinates, v4: texture coordinates 2 if available.

For DX9 programs, you can manually set the registers using the dcl_ statements.

Parameters
pixelShaderProgramString containing the source of the pixel shader program. This can be 0 if you don't want to use a pixel shader.
callbackPointer to an implementation of IShaderConstantSetCallBack in which you can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
baseMaterialBase material which renderstates will be used to shade the material.
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Returns the number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred. -1 is returned for example if a vertex or pixel shader program could not be compiled, the error strings are then printed out into the error log, and can be caught with a custom event receiver.

◆ addShaderMaterialFromFiles() [1/2]

virtual s32 irr::video::IGPUProgrammingServices::addShaderMaterialFromFiles ( io::IReadFile vertexShaderProgram,
io::IReadFile pixelShaderProgram,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

Parameters
vertexShaderProgramText file containing the source of the vertex shader program. Set to 0 if no shader shall be created.
pixelShaderProgramText file containing the source of the pixel shader program. Set to 0 if no shader shall be created.
callbackPointer to an IShaderConstantSetCallback object to which the OnSetConstants function is called.
baseMaterialbaseMaterial
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Returns the number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred. -1 is returned for example if a vertex or pixel shader program could not be compiled, the error strings are then printed out into the error log, and can be caught with a custom event receiver.

◆ addShaderMaterialFromFiles() [2/2]

virtual s32 irr::video::IGPUProgrammingServices::addShaderMaterialFromFiles ( const io::path vertexShaderProgramFileName,
const io::path pixelShaderProgramFileName,
IShaderConstantSetCallBack callback = 0,
E_MATERIAL_TYPE  baseMaterial = video::EMT_SOLID,
s32  userData = 0 
)
pure virtual

Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.

Parameters
vertexShaderProgramFileNameText file name containing the source of the vertex shader program. Set to 0 if no shader shall be created.
pixelShaderProgramFileNameText file name containing the source of the pixel shader program. Set to 0 if no shader shall be created.
callbackPointer to an IShaderConstantSetCallback object on which the OnSetConstants function is called.
baseMaterialbaseMaterial
userDataa user data int. This int can be set to any value and will be set as parameter in the callback method when calling OnSetConstants(). In this way it is easily possible to use the same callback method for multiple materials and distinguish between them during the call.
Returns
Returns the number of the material type which can be set in SMaterial::MaterialType to use the renderer. -1 is returned if an error occurred. -1 is returned for example if a vertex or pixel shader program could not be compiled, the error strings are then printed out into the error log, and can be caught with a custom event receiver.

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