Shadows

Problems building or running the engine, queries about how to use features etc.
Post Reply
jack9267
Gnoblar
Posts: 2
Joined: Tue Jun 28, 2016 1:20 am

Shadows

Post by jack9267 »

I'm trying to get basic shadows working via HLSL. I'm trying to create a small sort of editor and player.

https://dl.dropboxusercontent.com/u/5650647/Ogre.7z

* Requires D3D11

I have uploaded the entire release I've got so far so people can see it and give me some guide as to whats wrong?

http://pastebin.com/hvsNntVH

I have put my createScene code on pastebin if it helps.

I don't want people telling me to use the RT shader system as I would prefer to use HLSL directly and D3D11. Alongs I know whats wrong I should be able to port the shaders over to glsl and such.

I'm avoiding Cg since NVIDIA has declared it as obsolete.

I decided to use Ogre for this project as the scene manager will probably handle the world objects being scattered around far better than I could.

I know how to impliment the skeletal animations in HLSL (at least I have an idea), if the shadows work first then i'll be happy.

The issue i'm having is that the shadows appear to just be cutting off if I move the camera at particular angles.

Also would anyone know if or what any limits that apply to the shadow technique I'm using?

Thanks
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Shadows

Post by mkultra333 »

You'll have to tell people what version of Ogre you are using, some are using the old 1.x branch and some are using the new 2.x branch.

There's also the question of what type of shadows. Are they simple VSM spotlight shadow maps or are they some kind of split shadow maps. I assume they aren't stencil shadows, does anyone still use those? (Mobile maybe?)

My own DX11 HLSL Ogre 1.10 custom shadowing system uses a kind of VSM spotlight shadow map, my setup is horrendously complicated these days, with a shadow atlas and stuff, so I can't really post any useful code. But long, long ago it was originally based on nullsquared's soft shadow demo. Don't know if that's still available, and that was about 8 years ago.
Last edited by mkultra333 on Tue Jun 28, 2016 8:49 am, edited 1 time in total.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: Shadows

Post by mkultra333 »

One thing to watch out for when doing your own shadow coding is Ogre's infuriatingly tenacious culling. It can remove objects you think should be casting shadows in a scene because they are out of the view frustum.
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=88569
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
jack9267
Gnoblar
Posts: 2
Joined: Tue Jun 28, 2016 1:20 am

Re: Shadows

Post by jack9267 »

If you checked the download link you would be able to see.

I use 1.9 since it's the most stable as far as I know.

I posted the code in pastebin. I'm simply trying to get really basic shadows working nothing too advanced. Simply ogre already handles the main bulk of shadow mapping as far as I can tell.

That might make sense if it's culling the model but I don't think it's that simple. It's weird but I'll make a video if people don't want or can't run the demo.

I'm hoping to create a large world like 700 to -700 on x and z axis so not sure if the shadow mapping technique will work?

Obviously though the models are all split up so each model won't be much bigger than 10 game points or so. Except some road meshes.

Although we would still want ogre to cull generally to save rendering every mesh. Except when rendering the shadow map?

Seems http://ogre3d.org/forums/viewtopic.php? ... 21#p441670 has the same issue.
Post Reply