The use of Irrlicht learning.

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The use of Irrlicht learning.


Irrlicht is from the beginning of 2002 release, then I think it is not mature shader, I remember when the Direct3D8 shader is assembly code, very difficult to use, but Direct3D9 HLSL is not known, but OpenGL GLSL is not yet born. No shader, rendering can be very dull, and fixed the rendering mode very bloated. But now it is not the same, Irrlicht also supports very much shader, they can show very satisfactory results for users. So I began to try to use the Irrlicht shader model.

The demo program and source code download: here

Using shader, we must understand the interface: IGPUProgrammingServices. This interface is used to set the render using GPU, its function is only loaded shaders. When the shader loading after the success, the identifier will be given a S32 type. This identifier is used to mark the shader types. And then the identifier into IMeshSceneNode:: setMaterialType () can be. Of course, if you also need to set the consistence of variables in the operation of shader also (uniform) or variable (attribute), the need to create a callback function class inherits the IShaderConstantSetCallBack interface, and override the OnSetConstants () function is good. That is, the Shader is targeted at GLSL, HLSL I haven't contact.

I found the cartoon shader code from the book source code, and then imitate the example of rendering, the results as shown below

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Kelly at December 14, 2013 - 11:09 AM