Simple circle shadows

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
tyomalu
Posts: 2
Joined: Tue Oct 20, 2009 10:34 am

Simple circle shadows

Post by tyomalu »

Hi. I need to create such kind of node that drops circle shadows on plane floor. Two main problems are:
  • 1. How to draw shadow on floor without artifacts
  • 2. How to cut shadows at floor's edge
Shadows under circles in the following image shows what I need:
Image
Psan
Posts: 16
Joined: Sun Oct 04, 2009 7:07 pm

Re: Simple circle shadows

Post by Psan »

tyomalu wrote:
  • 1. How to draw shadow on floor without artifacts
You are bound to get artifacts with builtin shadows or even with opengl realtime stencil shadows. I found that the XEffects Reloaded shader pack has some nice shaders that produce smooth shadows. You can find it here on forums.
someguy99
Posts: 38
Joined: Sun Oct 11, 2009 11:20 am

Post by someguy99 »

So is your node a sphere?
I think youre talking about some old school fake shadows. I think you should just draw textures on the ground under the player. Maybe semi transparent image
Image
Image
tyomalu
Posts: 2
Joined: Tue Oct 20, 2009 10:34 am

Post by tyomalu »

someguy99 wrote:So is your node a sphere?
I think youre talking about some old school fake shadows. I think you should just draw textures on the ground under the player. Maybe semi transparent image
Yes, that exactly what I need. But how to do this in Irrlicht?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

If your objects are already spheres, you can use matrix4::buildShadowMatrix() to help you squish the geometry onto a plane. You can then render the geometry again as a shadow, as shown here. You'll have to tweak materials, but you'll get the idea.

If you just want to draw a circle under each a node, you could also just create a textured quad, use alpha to fade the edges of the circle of the texture, and render that quad just above the plane at the appropriate positions.

Travis
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

vitek wrote: If you just want to draw a circle under each a node, you could also just create a textured quad, use alpha to fade the edges of the circle of the texture, and render that quad just above the plane at the appropriate positions.
That would work on a totally flat ground but on a terrain with bumps and things it would start cutting in. It needs to be rendered after the terrain and before the player node.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Eigen wrote:That would work on a totally flat ground but on a terrain with bumps and things it would start cutting in. It needs to be rendered after the terrain and before the player node.
Yes it would, and that is exactly what the OP has requested...
tyomalu wrote:I need to create such kind of node that drops circle shadows on plane floor
Travis
Post Reply