Sign in to follow this  
wildboar

iPad3 static shadow maps

Recommended Posts

wildboar    320
Hmm so I implemented a small test for my mobile game engine. I knew that it ipad could not handle dynamic shadowmapping of the entire scene so I generate a 768x768 shadowmap at the start of the frame and leave it there, this is just done on the first frame and repeated on scene changes. It works pretty well producing very nice shadows which have nice quality with retina resolution and MSAA. But doing so my game performance drops from 60fps to 30-40fps depending how many mesh instances I have in the scene (I use frustum culling). I just cant understand why when having 5 extra meshes in the scene the frame rate drops so drasticly, I mean I am just sampling a static shadowmap once for each pixel.

How does infinity blade dungeons manage to have all these nice screen space effects combined with dynamic shadow mapping for characters. Is there some trick to this?

Share this post


Link to post
Share on other sites
freakchild    572
For stuff like this, I think it's always best to analyze it in the GPU profiling tools. That will at least help to understand whether or not it should be taking this time and maybe point out a specific problem. What do those tools say?

It's a long shot, but given I once had a very similar frame rate drop I would also quickly check that something you have done has not kicked in the 'slow gl' path. There's a tool in the core animation profiler that can help determine this. If you support both landscape and portrait modes...do all profiling in both because some things only occur in landscape due to rotation processing and you need to understand the differences. Edited by freakchild

Share this post


Link to post
Share on other sites
wildboar    320
I dont actually use apple tools at all. I am using a crossplatform API called marmalade which lets me code in C++
I am not sure what kind of profiling tools I can use with it as I cant even use gdebugger with it.

Share this post


Link to post
Share on other sites
EngineCoder    246
[quote name='wildboar' timestamp='1341940853' post='4957668']
I dont actually use apple tools at all. I am using a crossplatform API called marmalade which lets me code in C++
I am not sure what kind of profiling tools I can use with it as I cant even use gdebugger with it.
[/quote]
Xcode includes a handy tool called Instruments that can be used to find bottlenecks.

Share this post


Link to post
Share on other sites
L. Spiro    25621
I know I am late to the party but what you are trying to do is a complete match for the results you are getting. You can’t really do much in retina display—only the most basic of basic graphics.


Shadow mapping causes dependent texture reads which are terribly slow on iOS devices in the first place.
This is done for every pixel of the scene, and the device is fill-rate limited, which is a bad mix.

In fact you optimized away exactly the opposite of what you should have. Generating mipmaps is virtually free if done properly. [i]Using[/i] them is the problem.

Unreal Engine 3 generates shadow maps only for characters, and then all objects besides characters actually receive those shadows. Characters do not cast shadows on themselves nor on other characters. Characters often occupy a lot of the screen, so having them not receive shadows reduces fill-rate costs.


L. Spiro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this