Casting Receiving Shadows

Everything related to 3D programming
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Casting Receiving Shadows

Post by Thade »

Hi

I have some low poly trees - textures are with alpha channel
If I do not build a Shadowvolume ## BuildMeshShadowVolume(PlantMesh2) ## for the mesh then the trees look great but they do not cast a shadow
If I build a Shadowvolume I have a not so good looking shadow and the trees look terrible because they receive their own shadows which makes the transparent alpha parts visible.

I solved this problem in another engine I used before using fake shadow maps and a HLSL-shader I found in the internet - but have no idea how to fix it in PB 5.00beta3

I edited the material file with many different settings - all failed when I added BuildMeshShadowVolume ...

Question is: Is there a way to make an entity casts shadows (even considering transparent textures) but does not receive shadows itself ?
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Casting Receiving Shadows

Post by Fred »

From what i understand, this flag is per material, not per entity. I think you can do it like that:

http://www.ogre3d.org/tikiwiki/Materials

Code: Select all

material Material/SOLID/erdboden.jpg
{
    receive_shadows off
    ...
}
Just a shoot in the dark here :)
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Re: Casting Receiving Shadows

Post by Thade »

Thanks Fred

The Page is a great additional help - much better than the original Ogre Manual I went through - on the other hand I figured out how the functions and parameters fit together and tried hundreds of combinations. Actually I can write most Material files by hand out of my head now :)

The problem is, that the entity receives the shadows - with some more parameters for EntityRenderMode(#Entity, Mode) you could probably change the render behavior
#PB_Entity_CastShadowYes | #PB_Entity_ReceiveShadowsNo ... alternative #PB_Entity_ReceiveShadowsYes ... #PB_Entity_CastShadowNo for instance

Image Image

Left picture without BuildMeshShadowVolume(PlantMesh2) ... right picture with BuildMeshShadowVolume(PlantMesh2)

On the other hand - I would need another Shadow behavior anyway. Transparent parts of the Texture should not cast a shadow. Problably a feature for the next Beta :D

Cheers
--------------
Yes, its an Irish Wolfhound.
Height: 107 cm; Weight: 88 kg
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Re: Casting Receiving Shadows

Post by Olby »

Not sure if Ogre has this functionality in the first place. Honestly, based on my experience I don't think that stencil shadow volumes are designed to cast shadows from alpha masked surfaces. Guess you need to use custom made shaders for that unless there is something unexposed in PB's OGRE implementation.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Post Reply