Loading...
Searching...
No Matches
irr::video::IMaterialRendererServices Class Referenceabstract

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

`#include <IMaterialRendererServices.h>`

## Public Member Functions

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

## Detailed Description

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

Definition at line 20 of file IMaterialRendererServices.h.

## Constructor & Destructor Documentation

## ~IMaterialRendererServices()

virtual irr::video::IMaterialRendererServices::~IMaterialRendererServices | ( |  | ) |

inline virtual

Destructor.

Definition at line 25 of file IMaterialRendererServices.h.

## Member Function Documentation

## getVideoDriver()

virtual IVideoDriver * irr::video::IMaterialRendererServices::getVideoDriver | ( |  | ) |

pure virtual

Get pointer to the IVideoDriver interface.

Returns
  Pointer to the IVideoDriver interface

## setBasicRenderStates()

virtual void irr::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, grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and fog enabling.

Parameters

  material | The new material to be used.
  lastMaterial | The material used until now.
  resetAllRenderstates | Set to true if all renderstates should be set, regardless of their current state.

## setPixelShaderConstant() [1/4]

virtual bool irr::video::IMaterialRendererServices::setPixelShaderConstant | ( | const c8 * | name,
|  | const bool * | bools,
|  | int | count )

pure virtual

Bool interface for the above.

## setPixelShaderConstant() [2/4]

virtual bool irr::video::IMaterialRendererServices::setPixelShaderConstant | ( | const c8 * | name,
|  | 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

  name | Name of the variable
  floats | Pointer to array of floats
  count | Amount of floats in array.

Returns
  True if successful.

## setPixelShaderConstant() [3/4]

virtual bool irr::video::IMaterialRendererServices::setPixelShaderConstant | ( | const c8 * | name,
|  | const s32 * | ints,
|  | int | count )

pure virtual

Int interface for the above.

## setPixelShaderConstant() [4/4]

virtual void irr::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

  data | Data to be set in the constants
  startRegister | First register to be set.
  constantAmount | Amount of registers to be set. One register consists of 4 floats.

## setVertexShaderConstant() [1/4]

virtual bool irr::video::IMaterialRendererServices::setVertexShaderConstant | ( | const c8 * | name,
|  | const bool * | bools,
|  | int | count )

pure virtual

Bool interface for the above.

## setVertexShaderConstant() [2/4]

virtual bool irr::video::IMaterialRendererServices::setVertexShaderConstant | ( | const c8 * | name,
|  | 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);
core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
}
irr::video::IMaterialRendererServices
Interface providing some methods for changing advanced, internal states of a IVideoDriver.
Definition IMaterialRendererServices.h:21
irr::video::IMaterialRendererServices::setVertexShaderConstant
virtual bool setVertexShaderConstant(const c8 *name, const f32 *floats, int count)=0
Sets a constant for the vertex shader based on a name.
irr::video::IMaterialRendererServices::getVideoDriver
virtual IVideoDriver * getVideoDriver()=0
Get pointer to the IVideoDriver interface.
irr::video::IVideoDriver
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:257
irr::video::IVideoDriver::getTransform
virtual const core::matrix4 & getTransform(E_TRANSFORMATION_STATE state) const =0
Returns the transformation set by setTransform.
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2235
irr::video::ETS_VIEW
@ ETS_VIEW
View transformation.
Definition IVideoDriver.h:55
irr::video::ETS_WORLD
@ ETS_WORLD
World transformation.
Definition IVideoDriver.h:57
irr::video::ETS_PROJECTION
@ ETS_PROJECTION
Projection transformation.
Definition IVideoDriver.h:59
irr::f32
float f32
32 bit floating point variable.
Definition irrTypes.h:104
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66

Parameters

  name | Name of the variable
  floats | Pointer to array of floats
  count | Amount of floats in array.

Returns
  True if successful.

## setVertexShaderConstant() [3/4]

virtual bool irr::video::IMaterialRendererServices::setVertexShaderConstant | ( | const c8 * | name,
|  | const s32 * | ints,
|  | int | count )

pure virtual

Int interface for the above.

## setVertexShaderConstant() [4/4]

virtual void irr::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

  data | Data to be set in the constants
  startRegister | First register to be set
  constantAmount | Amount of registers to be set. One register consists of 4 floats.

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

- IMaterialRendererServices.h

- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0