shadows

Can you see something wrong here

window->get_render().set_shader_auto();

 PT(Spotlight) spot= new Spotlight("Spotlight 1");
   spot->set_color(LVecBase4f(100, 0, 0, 1));
   spot->set_shadow_caster(true, 512, 512);
 NodePath spotnp=window->get_render().attach_new_node(spot);
   spotnp.set_pos(44, -680, 20);
   
   window->get_render().set_light(spotnp);
 

14 guys did not find something
so
here is a problem with shadows

I don’t understand what problem you’re seeing.

can not see shadows on the screen

Hi

I added your lines of code to my program and it worked but I had to add the line to tell the spot where to point using: spotnp.look_at(x,y,z) where x,y,z is the point where it should shine.

Also, the color RGB values should be in the range 0 to 1
you have:
spot->set_color(LVecBase4f(100, 0, 0, 1));
did you mean:
spot->set_color(LVecBase4f(.39, 0, 0, 1));

Do you have a lot of ambient light in your scene ?
I turned my ambient off so I can see the shadow…

tim

Thanks a lot
Did you guys see my screen shot on the post
if you can not see the screen shot you need reload the page.
I just found that.

I guess the shadows have to look like
panda3d.org/manual/index.php … s:_Shadows

so on the building i have to have the shadow from the rock

yes, I saw the screen shot, I clicked on it to see full size.

Are things still not working ?
Looks like there is no ambient light on the stone, but
everything else looks very red. I put model panda next to a model cabin and cast shadow on both terrain and cabin wall. Make sure you don’t have any node.set_light_off() on your building model or ground plane, I don’t see any cast shadow anywhere in your scene. Maybe you can put a model on the spot light node path to see where the spot light is being placed and pointed.

tim

yes
when i put spot->set_shadow_caster(true, 512, 512);

ive got
:gobj(error): Shader encountered an error.
:gobj(error): created-shader: Invalid type for a k-parameter (uniform in unknown k_slighttex0)

and no shadows

oh, a shader error
I looked around for that specific error but haven’t found anything, but some people with Mac were having shader problems. Are you using a Mac ?

I’m using a PC with Panda version 1.7.0
What version are you using ?

I saw some comments for Mac like try updating graphic drives, and one that said:
“Try to set to false basic-shaders-only in your Config.prc file”
Not sure if any of these will help you…

I’m sure one of the Panda core developers can help you with this problem.

Best wishes,

tim

no

1.7.0b-1-lucid2

I have the last one

Thanks for your time

I just checked in a fix to CVS.

I am sorry i did not get you. Is here a patch to fix this problem ?

Yes. If you get the latest buildbot build of Panda3D, it should work.

i loaded the panda from here panda3d.org/download.php?pla … =1.7.0&sdk

panda3d_1.7.0-ubuntulucid_i386.deb

and the problem has not gone.

He was referring to this.

yep everything is cool

Thanks a lot guys!!!