iPad3 static shadow maps

Started by
3 comments, last by L. Spiro 11 years, 9 months ago
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?
Advertisement
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.
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.

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.

Xcode includes a handy tool called Instruments that can be used to find bottlenecks.
My iOS 3D action/hacking game: http://itunes.apple....73873?ls=1&mt=8
Blog
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. Using 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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement