Page 1 of 1

Simple circle shadows

Posted: Sun Oct 25, 2009 11:45 am
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

Re: Simple circle shadows

Posted: Sun Oct 25, 2009 12:23 pm
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.

Posted: Sun Oct 25, 2009 1:28 pm
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

Posted: Sun Oct 25, 2009 2:20 pm
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?

Posted: Sun Oct 25, 2009 4:13 pm
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

Posted: Sun Oct 25, 2009 4:21 pm
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.

Posted: Sun Oct 25, 2009 7:02 pm
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