Basic shadows that cast only on the ground

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
squisher
Competition winner
Posts: 91
Joined: Sat May 17, 2008 2:23 am
Contact:

Basic shadows that cast only on the ground

Post by squisher »

Hi all, I know there are a million threads on this but I was just hoping if anyone had a simple working solution in place.

I am writing a very basic 3D game for my kid and I don't need any kind of impressive graphics, just the most basic shadows that have 1 and only 1 purpose: to see how far an object is from the ground. I dont need shadows to hit any other object, i dont need sharp edges on the shadows, I'd even be happy with just a fuzzy circle. (The built-in shadows are unusably slow.)

Any help would be greatly appreciated.
Current project: StarDust. A single player galactic conquest game.
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: Basic shadows that cast only on the ground

Post by Seven »

an easy method would be to load up a small circle texture (or whatever rough shape your object is) and apply it to a thin cube scenenode. (Y scale of .1) and use transparency
test a ray from the light source through the center of the object in question and to the 'floor'.
At the intersection, scale the circle textured node as a function of the distance from the light source and then render it.

it wouldnt be scientific, but it would give you a nice, easy 'shadow'
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Basic shadows that cast only on the ground

Post by hendu »

If you have < 4 casters, you could also easily do that in your terrain shader.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Basic shadows that cast only on the ground

Post by thanhle »

Search for decal source code in the forum.
I think that will make a good shadow under the feet.

Don't ask me how to use it. I personally haven't use it. But I think it might work for your purpose.

Regards
Thanh
Post Reply