Multiple lights with XEffects

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
Hotari
Posts: 9
Joined: Tue Dec 25, 2018 2:57 am

Multiple lights with XEffects

Post by Hotari »

Hello.

I compiled example1 but a shadow of the last additional light was only drawn.
OpenGL:
Image

This doesn't happen in Direct3D9, only in OpenGL.
Direct3D9:
Image

I did not change the example code.
The ambient color also doesn't work.

How do I solve them?

Thank you.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Multiple lights with XEffects

Post by robmar »

Hi, Xeffects renders a shadow map from one light only to produce shadows, so extra lights will not affect shadows.
You can render multiple shadow maps, and altering the code to do this is relatively easy.
Frame rates will drop though, as every etra light requires a complete redraw of each scene.
You´ll need to re-render the depth map, calling the same code but using a different light, then change the shader to look-up the depth value from both depth maps. The code is easy enough to follow if you´ve experience with this sort of thing, if not, it will take you a good few hours of digging, thinking and research on the principles.
Behaviour with different drivers is normal because the code has not been exhaustively tested for all drivers.
Hotari
Posts: 9
Joined: Tue Dec 25, 2018 2:57 am

Re: Multiple lights with XEffects

Post by Hotari »

I'll try to effort to modify the code.
Although, I don't know why pre-compiled binary works well if even the device is OpenGL.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Multiple lights with XEffects

Post by robmar »

Probably the binary was compiled from different code changes, hence different functionality.
In any case, XEffects is easy enough to follow although it will take some time to go through, once you have done that, you will be able to make the changes you need in future easily.
No pain, no gain as they say! :)
Hotari
Posts: 9
Joined: Tue Dec 25, 2018 2:57 am

Re: Multiple lights with XEffects

Post by Hotari »

Thank you so much!
Harch
Posts: 75
Joined: Wed Oct 08, 2014 9:01 pm

Re: Multiple lights with XEffects

Post by Harch »

Hello! Did you fix the problem? (irrlicht 'trunk' work correctly with xEffects, problem in irrlicht 1.8.x).
Post Reply