cocos2d-x-dynamic-lighting-example icon indicating copy to clipboard operation
cocos2d-x-dynamic-lighting-example copied to clipboard

Multiple light sources?

Open jonnyijapan opened this issue 8 years ago • 4 comments

It looks like this only supports one light source out of the box.

Not sure here but if LightEffect::prepareForRender() was rewritten to somehow work with several light positions instead of just one, that could work? Any other pitfalls? Does the shader itself need to be updated?

jonnyijapan avatar Mar 01 '16 09:03 jonnyijapan

did u get Multiple lights work if yes can u share the code .

Kotaiba avatar Apr 17 '16 21:04 Kotaiba

No I didn't really try anything more, yet. I think the shader needs to change for that.

2016/04/18 6:09$B!"(BKotaiba Jabkji [email protected] $B$N%a%C%;!<%8(B:

did u get Multiple lights work if yes can u share the code .

$B!=(B You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

jonnyijapan avatar Apr 17 '16 23:04 jonnyijapan

It's just because the configuration limit. Check these lines in CCConfiguration.cpp 58. , _maxDirLightInShader(1) 59. , _maxPointLightInShader(1) 60. , _maxSpotLightInShader(1)

erdjei avatar Sep 07 '17 12:09 erdjei

Is this fixed? How can I display multiple lights?

dlsehf1263 avatar Mar 26 '20 12:03 dlsehf1263