Hi,
I got a serious issue with set_shadow_caster() since a few days. It all started when I was switching my Spotlight to a DirectionalLight, and I wasn’t able to resolve this issue.
Here is the basic environment and light setup:
// Load the environment model & activate auto-shaders
window->get_render().set_shader_auto();
NodePath environ = window->load_model(framework.get_models(), "models/map/map");
environ.reparent_to(window->get_render());
environ.set_pos(0, 0, 0);
//Add a sunlight
PT(DirectionalLight) d_sun;
d_sun = new DirectionalLight("Sun");
d_sun->set_color(LVecBase4f(2, 2, 2, 1));
NodePath d_sun_np = window->get_render().attach_new_node(d_sun);
d_sun_np.set_hpr(-50, -60, 0);
d_sun_np.set_pos(-200,-200,-400);
d_sun->set_shadow_caster(true, 512, 512);
d_sun->show_frustum();
d_sun->get_lens()->set_fov(60);
d_sun->get_lens()->set_near_far(600, 1000);
d_sun->get_lens()->set_film_size(500, 500);
window->get_render().set_light(d_sun_np);
window->get_render().set_shader_input("sun", d_sun_np);
This black upper half of the screen seems not being influenced by my light. But it stays always at the same position in the Panda window. If I move my camera, I can see the parts of the map which were black before (because now they are on the lower half of the Panda window). If I add my ambient light, the upper half will only be influenced by this, the lower half by both. Although it seems to be that on the upper half, with my ambient light, there will be no bump mapping nor spectacular shader effects drawn. (see below)
So my question is: what the hell is this and how do I resolve it? =)
Thank you for your time.
Edit: I just realized, that this is a great way to do before shader effects/after shader effects shots xD