Mixing Pointlight and other lights shadows in GLSL through p3d_LightSourceParameters

Dear all -

I normally use specific buffers to generate per-light shadow maps, and thus this allows me to mix all sort of light shadows and in particular PointLight and Spotlight/DirectionalLight ones.

However, I wanted to check if anybody knows a “neat way” (or hacking way?) to mix pointlights shadows and other light types of shadows through the native p3d_LightSourceParameters struct…

In particular, I tried managing on the same scene 2 kinds of shaders with either “p3d_LightSourceParameters.sampler2Dshadow” or “p3d_LightSourceParameters.samplerCube” to force P3D to issue the shadow cube and 2D maps , but I do not manage to issue proper shadowmaps without generating messages stating inconsistency between the two p3d_LightSourceParameters (which is not surprising, I suspect the gsg to control that consistency).

So: if anybody has a solution to mix PointLight and other type of lights shadows with the p3d_LightSourceParameters or other “more native” P3D solutions, I would be interested to know!

Thanks

This is possible if you create a shadow map for light sources yourself, rather than using the sampler2DShadow variable of the p3d_LightSourceParameters structure. sampler2DShadow this is already a separate buffer for you, which was taken care of by Panda3D.

Thanks serega-kkz for your reply.

I think you confirm my understanding that there is no other way than creating my own shadow buffers, as I am currently doing.

Thanks!

Unfortunately mixing point and spot lights is not supported without passing in something custom via set_shader_input(). This issue is being tracked here: p3d_LightSourceParameters shadowMap not universal. · Issue #707 · panda3d/panda3d · GitHub

Yes, thanks for pointing out this issue on github.
Thanks for your reply.