You are not logged in.

#1 2011-01-29 18:53:32

owen
Member

How do I make simple shadows?

So now that I have my buildings and bullets.  I read somewhere that lights don't actually cause shadows to appear.  whats the easiest way to start baking/casting some shadows in GRRLIB?

I want something looking like this:  http://vimeo.com/9284867

Offline

 

#2 2011-01-30 18:20:22

Crayon
Bad Mother Fucker

Re: How do I make simple shadows?

I'm sorry, I did not code the 3D stuff, but the examples called 3D_Light1, 3D_Light2, 3D_Light3 and 3D_Light4 are not OK for what you need to do?

Offline

 

#3 2011-01-30 22:13:42

owen
Member

Re: How do I make simple shadows?

I am already familiar with those examples but they do not have shadows in them, only lights.  I think.

Offline

 

#4 2011-01-31 20:06:19

NoNameNo
Administrator

Re: How do I make simple shadows?

like in real wink

put your cam at the light position and looking at your light direction. turn the light off, capture it, then replace your cam where you want it to be, turn light on. you have now a nice texture of the shadow wink map it where you want wink

Offline

 

#5 2011-01-31 20:19:23

owen
Member

Re: How do I make simple shadows?

What?  I'm confused by what you just said.  Why do I have to turn off the lights?

Offline

 

#6 2011-01-31 21:08:03

NoNameNo
Administrator

Re: How do I make simple shadows?

you have to done it in two steps,

1/ render the shadow (so you need to light off) and grab it to a texture (you will have to put your cam at the light position)
2/ clear the screen
3/ render your object as usually (light on) cam at the normal place, (and use the shadow texture of step 1 to map the object you want wink

Offline

 

#7 2011-01-31 21:56:31

owen
Member

Re: How do I make simple shadows?

OK, I understand what you are saying now.  My problem is step 1, how do I render a shadow?

Offline

 

#8 2011-01-31 22:16:34

NoNameNo
Administrator

Re: How do I make simple shadows?

shadow = your object  seen at the light position and direction mapped on a surface
i adivised you to turn off the light before rendering shadow to have a black object

Offline

 

#9 2011-02-01 17:31:16

owen
Member

Re: How do I make simple shadows?

Oh yes, I understand what you are saying now, I will attempt to do it (I hope it does not kill my framerate).  I also read wikipedia and they said the samething but now I understand what is going on.  http://en.wikipedia.org/wiki/Shadow_mapping

Offline

 

Board footer

Powered by FluxBB