[SOLVED] Circle shadow under character technique

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

[SOLVED] Circle shadow under character technique

Post by kjuanlu »

Hello, I'm trying to find information on the technique used to paint a circle shadow under the character like this:

Image

But I dont know how the technique is called, and how to implement it on Ogre iPhone Port (without using stencil buffer).

Anyone know his name?

Someone knows how it was implemented in the ancient games?.

Thanks
Last edited by kjuanlu on Thu Aug 19, 2010 2:43 am, edited 1 time in total.
Ogre-iPhone user.
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

Render to Texture?

Render to Texture is support on OpenGL ES1?
Ogre-iPhone user.
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Circle shadow under character technique

Post by masterfalcon »

Yeah, rendering to a texture does work. One of the tutorial shows how to set it up, http://www.ogre3d.org/tikiwiki/Intermediate+Tutorial+7

That may be a bit much though, all you really need is to project a texture onto the terrain below.
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

Thanks, when I have something I'll show
Ogre-iPhone user.
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

Ogre-iPhone user.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Re: Circle shadow under character technique

Post by Praetor »

They are called "blob" shadows.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

Have been all day trying to get this technique with projective decal (Intermediate tutorial 6), and others tutorials (terrainDecal etc..), but no way.

It also has to be difficult to know the coordinates of the mesh. And also, if it depends on the material, UVWrap objects does not help, and shadow repeats in every object with this material. I have a Lightmap in the second tex_coord for a single mesh, that represents all the static scene.

I have to find another solution, I'm going crazy after so many hours in front of monitor.

I attach the results with a temp decal (its a circle, it shows wrong), (I will change with a bob shadow), and my scene. The decal image dont show correctly. All the scene is a single mesh (with two sub-materials). I try to apply de decal only in one sub-material.

In conclusion, I have no idea where to go

PD: The screenshot is take using this code for projective decal: http://www.ogre3d.org/addonforums/viewtopic.php?t=6371
Attachments
IMG_0054.PNG
Ogre-iPhone user.
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

I try it with decals, with ray cast to polygon level, and now, I try it with a simple plane and a texture with alpha channel.
It runs good, but now i have another problem. Look at the images
when I approach a slope, the texture is painted on the air.

Any suggestions?
Attachments
when I approach a slope, the texture is painted on the air.
when I approach a slope, the texture is painted on the air.
In a plane looks good
In a plane looks good
Ogre-iPhone user.
User avatar
kjuanlu
Greenskin
Posts: 113
Joined: Fri Jul 31, 2009 2:27 pm
Location: Spain

Re: Circle shadow under character technique

Post by kjuanlu »

Solved¡¡¡

I changed to GLES2, I learned OpenGL ES shading languaje, and I wrote a shader for projective Texturing.
Then I extend the shader for blending with a diffuse image, and I will blend with a lightmap too.

I pass a param to a shader in every frame with this:
ps_params->setNamedConstant("texViewProjMatrix",mDecalFrustum->getProjectionMatrix() * mDecalFrustum->getViewMatrix());

This is the result:


When I´ve time, I will write a wiki for projective decals for iPhone GLES2 with shaders
Attachments
IMG_0076.PNG
IMG_0076.PNG (69.24 KiB) Viewed 1232 times
Ogre-iPhone user.
Post Reply