Shadows under feet

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Shadows under feet

Post by pippy3 »

I've decided to do a basic blob under the player / other objects. What's the best approach to doing this?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Calculate the position of the ground relative to the object you want to put your blob shadow, and put the blob shadow there.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

Mel wrote:Calculate the position of the ground relative to the object you want to put your blob shadow, and put the blob shadow there.
haha yes.

I was looking for more something like this

http://irrlicht.sourceforge.net/phpBB2/ ... 5ec2e6eb06

or

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=22261

Obviously the shadow can't be a mesh. Or a billboard. It will have to be a texture on a material on another layer of a mesh.

I have no idea where to begin, real world vectors into texture cords seems very hard to do.

vitek's solution looks like it puts builds a shadow from a texture and asks the driver to render it on top of everything else.
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

I'm just going to scrap the shadow feature in my game. Sometimes unity3d looks very tempting.

Stensil buffers create too many artifacts.

Xeffects only works on limited hardware.

Even simple textures for shadows only works with meshes, which will create artifacts.


I remember reading in the API a way to do this, but they've taken out this feature.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

the simplest solution is to darken terrain vertices under the player. that's not very realistic but easy and fast to apply. you need to update few vertices and if the terrain is not a big mesh but a tiled terrain the speed of updating is great.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

blob shadows are extra meshes, the only way to create such an effect as you comment us to use projectors, something Irrlicht lacks for the time being.

Sometimes, simply there aren't easy solutions.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

REDDemon wrote:the simplest solution is to darken terrain vertices under the player. that's not very realistic but easy and fast to apply. you need to update few vertices and if the terrain is not a big mesh but a tiled terrain the speed of updating is great.
My first reaction too. Sadly the meshes under the player are larger than the shadow - thusly won't work that great. Also the objects under the player are using a material type that doesn't have shadow cords.

Thanks for that Mel - sometimes it's best knowing it's not worth it before you set off. I could have wasted many hours trying to get it to work.
Post Reply