Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::video::IMaterialRendererServices Class Referenceabstract

Interface providing some methods for changing advanced, internal states of a IVideoDriver. More...

#include <nirtcpp/core/engine/IMaterialRendererServices.hpp>

Public Member Functions

virtual ~IMaterialRendererServices ()
 Destructor.
 
virtual void setBasicRenderStates (const SMaterial &material, const SMaterial &lastMaterial, bool resetAllRenderstates)=0
 Can be called by an IMaterialRenderer to make its work easier.
 
virtual s32 getVertexShaderConstantID (const c8 *name)=0
 Return an index constant for the vertex shader based on a name.
 
virtual bool setVertexShaderConstant (s32 index, const f32 *floats, int count)=0
 Sets a constant for the vertex shader based on a name.
 
virtual bool setVertexShaderConstant (s32 index, const s32 *ints, int count)=0
 Int interface for the above.
 
virtual bool setVertexShaderConstant (s32 index, const u32 *ints, int count)=0
 Uint interface for the above.
 
virtual void setVertexShaderConstant (const f32 *data, s32 startRegister, s32 constantAmount=1)=0
 Sets a vertex shader constant.
 
virtual s32 getPixelShaderConstantID (const c8 *name)=0
 Return an index constant for the pixel shader based on a name.
 
virtual bool setPixelShaderConstant (s32 index, const f32 *floats, int count)=0
 Sets a constant for the pixel shader based on a name.
 
virtual bool setPixelShaderConstant (s32 index, const s32 *ints, int count)=0
 Int interface for the above.
 
virtual bool setPixelShaderConstant (s32 index, const u32 *ints, int count)=0
 Uint interface for the above.
 
virtual void setPixelShaderConstant (const f32 *data, s32 startRegister, s32 constantAmount=1)=0
 Sets a pixel shader constant.
 
NIRT_DEPRECATED bool setVertexShaderConstant (const c8 *name, const f32 *floats, int count)
 
NIRT_DEPRECATED bool setVertexShaderConstant (const c8 *name, const s32 *ints, int count)
 
NIRT_DEPRECATED bool setPixelShaderConstant (const c8 *name, const f32 *floats, int count)
 
NIRT_DEPRECATED bool setPixelShaderConstant (const c8 *name, const s32 *ints, int count)
 
virtual IVideoDrivergetVideoDriver ()=0
 Get pointer to the IVideoDriver interface.
 

Detailed Description

Interface providing some methods for changing advanced, internal states of a IVideoDriver.

Member Function Documentation

◆ getVideoDriver()

virtual IVideoDriver * nirt::video::IMaterialRendererServices::getVideoDriver ( )
pure virtual

Get pointer to the IVideoDriver interface.

Returns
Pointer to the IVideoDriver interface

◆ setBasicRenderStates()

virtual void nirt::video::IMaterialRendererServices::setBasicRenderStates ( const SMaterial material,
const SMaterial lastMaterial,
bool  resetAllRenderstates 
)
pure virtual

Can be called by an IMaterialRenderer to make its work easier.

Sets all basic renderstates if needed. Basic render states are diffuse, ambient, specular, and emissive color, specular power, bilinear and trilinear filtering, wireframe mode, gouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and fog enabling.

Parameters
materialThe new material to be used.
lastMaterialThe material used until now.
resetAllRenderstatesSet to true if all renderstates should be set, regardless of their current state.

◆ setPixelShaderConstant() [1/4]

NIRT_DEPRECATED bool nirt::video::IMaterialRendererServices::setPixelShaderConstant ( const c8 name,
const f32 floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Nirtcpp 2.0

◆ setPixelShaderConstant() [2/4]

NIRT_DEPRECATED bool nirt::video::IMaterialRendererServices::setPixelShaderConstant ( const c8 name,
const s32 ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Nirtcpp 2.0

◆ setPixelShaderConstant() [3/4]

virtual void nirt::video::IMaterialRendererServices::setPixelShaderConstant ( const f32 data,
s32  startRegister,
s32  constantAmount = 1 
)
pure virtual

Sets a pixel shader constant.

Can be used if you created a shader using pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.

Parameters
dataData to be set in the constants
startRegisterFirst register to be set.
constantAmountAmount of registers to be set. One register consists of 4 floats.

◆ setPixelShaderConstant() [4/4]

virtual bool nirt::video::IMaterialRendererServices::setPixelShaderConstant ( s32  index,
const f32 floats,
int  count 
)
pure virtual

Sets a constant for the pixel shader based on a name.

This can be used if you used a high level shader language like GLSL or HLSL to create a shader. See setVertexShaderConstant() for an example on how to use this.

Parameters
indexIndex of the variable
floatsPointer to array of floats
countAmount of floats in array.
Returns
True if successful.

◆ setVertexShaderConstant() [1/4]

NIRT_DEPRECATED bool nirt::video::IMaterialRendererServices::setVertexShaderConstant ( const c8 name,
const f32 floats,
int  count 
)
inline
Deprecated:
. This method may be removed by Nirtcpp 2.0

◆ setVertexShaderConstant() [2/4]

NIRT_DEPRECATED bool nirt::video::IMaterialRendererServices::setVertexShaderConstant ( const c8 name,
const s32 ints,
int  count 
)
inline
Deprecated:
. This method may be removed by Nirtcpp 2.0

◆ setVertexShaderConstant() [3/4]

virtual void nirt::video::IMaterialRendererServices::setVertexShaderConstant ( const f32 data,
s32  startRegister,
s32  constantAmount = 1 
)
pure virtual

Sets a vertex shader constant.

Can be used if you created a shader using pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.

Parameters
dataData to be set in the constants
startRegisterFirst register to be set
constantAmountAmount of registers to be set. One register consists of 4 floats.

◆ setVertexShaderConstant() [4/4]

virtual bool nirt::video::IMaterialRendererServices::setVertexShaderConstant ( s32  index,
const f32 floats,
int  count 
)
pure virtual

Sets a constant for the vertex shader based on a name.

This can be used if you used a high level shader language like GLSL or HLSL to create a shader. Example: If you created a shader which has variables named 'mWorldViewProj' (containing the WorldViewProjection matrix) and another one named 'fTime' containing one float, you can set them in your IShaderConstantSetCallBack derived class like this:

virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
{
video::IVideoDriver* driver = services->getVideoDriver();
f32 time = (f32)os::Timer::getTime()/100000.0f;
services->setVertexShaderConstant("fTime", &time, 1);
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
}
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Interface providing some methods for changing advanced, internal states of a IVideoDriver.
Definition IMaterialRendererServices.hpp:21
virtual IVideoDriver * getVideoDriver()=0
Get pointer to the IVideoDriver interface.
virtual bool setVertexShaderConstant(s32 index, const f32 *floats, int count)=0
Sets a constant for the vertex shader based on a name.
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.hpp:152
virtual const core::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
@ ETS_VIEW
View transformation.
Definition IVideoDriver.hpp:56
@ ETS_WORLD
World transformation.
Definition IVideoDriver.hpp:58
@ ETS_PROJECTION
Projection transformation.
Definition IVideoDriver.hpp:60
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110
Parameters
indexIndex of the variable
floatsPointer to array of floats
countAmount of floats in array.
Returns
True if successful.

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

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print