Question about shaders

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
far_cry
Posts: 4
Joined: Sun Jul 27, 2008 7:14 pm

Question about shaders

Post by far_cry »

Hi guys, just a few quesions, please if there is any one can answer me.
Why I have to use video::IVideoDriver* driver = services->getVideoDriver() in the shader callback instead of video::IVideoDriver* driver = device->getVideoDriver() returned by the device?

Is there any way that I can use the video::IMaterialRendererServices* services in the main program (not in the callback)?

How I can get the driver of the services and use it in the main program?

Is there a difference between the world matrix returned by the driver of the services, and the world matrix returned by the driver of the device?

thanks.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

They are the same driver. A pointer is returned to the same video driver, so everything is the same. This is dangerous information, but in D3D9 you can actually cast the IVideoDriver* that you get from the device into an IMaterialRendererServices*, or you can just steal the pointer to IMaterialRendererServices* from any shader callback you have, and use it somewhere else before a draw call (But after driver->setMaterial()).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply