Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualInvalidPointer

Posted 16 October 2012 - 09:02 PM

Hello guys. Sorry for my English in advance.


You only need to apologize if it's your native language Posted Image

In brief: I’d like to get my game characters outlined like in the game MyBrute (http://www.mybrutech...m-simulator.jpg)
The character animation consists of a number of images that move around (it all works on OpenGLES2.0, iOS). I’d want to outline the animation dynamically while it’s playing, with all the moving parts.
I’ve already tried:
1. To make a virtual texture out of the animation, then to get the information about this texture and make the stroke (but FPS goes down a lot), then to draw the texture in the scene.
2. To make a virtual texture out of the animation and then to use a pixel shader on it while rendering.
I have noticed that drawing a texture lowers FPS by 10%, which is quite strange to me.
Probably, someone could think of any solution? And why you think drawing a texture affects FPS so much?
Thanks a lot in advance!


Never, never, ever use FPS to measure performance-- it doesn't scale linearly! The difference between 1,000FPS and 900FPS is on the order of microseconds. The difference between 60FPS and 30FPS is literally hundreds of times that.

For your actual problem-- I would suggest doing things in three layers: At asset creation time, create a mask texture for each piece that consists of a scaled-up/blurred alpha mask (This could be an interesting read) At runtime, draw all your regular pieces as normal. Next, draw all the bits again, but this time bias the depth value slightly and use the blurred/fake distance field texture. So long as you have depth-testing enabled, fillrate consumption should still be at manageable levels since the original sprites will mask out areas already drawn to (early depth-stencil testing is out, but we don't care since this is an ultra-cheap shader) and we can skip all the complex outline shader work.

EDIT: Figures are approximate :)

#1InvalidPointer

Posted 16 October 2012 - 08:36 AM

Hello guys. Sorry for my English in advance.


You only need to apologize if it's your native language :)

In brief: I’d like to get my game characters outlined like in the game MyBrute (http://www.mybrutech...m-simulator.jpg)
The character animation consists of a number of images that move around (it all works on OpenGLES2.0, iOS). I’d want to outline the animation dynamically while it’s playing, with all the moving parts.
I’ve already tried:
1. To make a virtual texture out of the animation, then to get the information about this texture and make the stroke (but FPS goes down a lot), then to draw the texture in the scene.
2. To make a virtual texture out of the animation and then to use a pixel shader on it while rendering.
I have noticed that drawing a texture lowers FPS by 10%, which is quite strange to me.
Probably, someone could think of any solution? And why you think drawing a texture affects FPS so much?
Thanks a lot in advance!


Never, never, ever use FPS to measure performance-- it doesn't scale linearly! The difference between 1,000FPS and 900FPS is on the order of microseconds. The difference between 60FPS and 30FPS is literally hundreds of times that.

For your actual problem-- I would suggest doing things in three layers: At asset creation time, create a mask texture for each piece that consists of a scaled-up/blurred alpha mask (This could be an interesting read) At runtime, draw all your regular pieces as normal. Next, draw all the bits again, but this time bias the depth value slightly and use the blurred/fake distance field texture. So long as you have depth-testing enabled, fillrate consumption should still be at manageable levels since the original sprites will mask out areas already drawn to (early depth-stencil testing is out, but we don't care since this is an ultra-cheap shader) and we can skip all the complex outline shader work.

PARTNERS