So I started with the samples, put a sun in a scene, clouds, terrain, and then dropped the little animated viking dude on the terrain and noticed there was no shadow being cast from him onto the terrain.
If I look at the shadow sample (it uses a plain instead of terrain) it works there.
I have since been through every sample I could find, google, forums, website trying to get an animated model that runs around on the terrain to cast a shadow on the terrain. no luck.
Does someone have an actually working code sample that works, where a model (like a player that walks across the terrain) that will cast a shadow on the terrain? would be nice to not be a hack where you just put a blob shadow down, but
and actual shadow that you can see on the terrain?
Thank you in advance!
Shadows on Terrain
Re: Shadows on Terrain
If you're using Direct3D, the stencil shadows are disabled, use OpenGL instead, or use a shadow mapping technique.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Shadows on Terrain
What? Since when are stencil shadows disabled for d3d?
Re: Shadows on Terrain
I am guessing now, but i think Mel means the Demo that comes with Irrlicht - there you don't have shadows with d3d ( OpenGL works ok ).
But the problem must be somewhere inside the demo code, because 'SpecialFX' has working shadows with d3d and OpenGL.
But the problem must be somewhere inside the demo code, because 'SpecialFX' has working shadows with d3d and OpenGL.
Re: Shadows on Terrain
You're right, shadows are messed up with d3d for some reason.
In a test application, they also make the hud disappear for some reason.
In a test application, they also make the hud disappear for some reason.
Re: Shadows on Terrain
The stencil shadows have some problems yet to be solved, namely the adjacency calculations producing random "infinite shadow projection" artifacts (those large streaks that appear randomly on the shadows, they disappear when the adjacency calculations aren't used), and some bias on the ZBuffer that cause cracks to appear on the shadows themselves. As for the HUD disappereances, that is mostly due to how the stencil shadows are drawn, after the stencil buffer is calculated, a screen aligned quad is drawn using a material which performs a stencil test: any pixel that has a value greater than 1 in the stencil buffer is drawn, and the rest are left untouched.
Ah, my bad, indeed, the special FX example has stencil shadows enabled. I don't know why they aren't working on the demo. Maybe they don't enable the stencil buffer when creating the D3D device?...
Ah, my bad, indeed, the special FX example has stencil shadows enabled. I don't know why they aren't working on the demo. Maybe they don't enable the stencil buffer when creating the D3D device?...
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Posts: 2
- Joined: Thu Oct 06, 2016 6:50 pm
Re: Shadows on Terrain
still haven't had much luck, even using the opengl options
tried all sorts of settings not only to light the dwarf, but to try and cast a shadow on terrain.
tried all sorts of settings not only to light the dwarf, but to try and cast a shadow on terrain.