Page 1 of 1

Multiple lights with XEffects

Posted: Sat Jan 26, 2019 8:15 am
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.

Re: Multiple lights with XEffects

Posted: Tue Jan 29, 2019 8:25 am
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.

Re: Multiple lights with XEffects

Posted: Tue Jan 29, 2019 1:07 pm
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.

Re: Multiple lights with XEffects

Posted: Wed Jan 30, 2019 1:03 pm
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! :)

Re: Multiple lights with XEffects

Posted: Thu Jan 31, 2019 11:26 am
by Hotari
Thank you so much!

Re: Multiple lights with XEffects

Posted: Wed Aug 07, 2019 7:32 pm
by Harch
Hello! Did you fix the problem? (irrlicht 'trunk' work correctly with xEffects, problem in irrlicht 1.8.x).