www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Thomas. on January 23, 2013, 11:29:19 pm

Title: FrameBuffer.blit(RGBColor...)
Post by: Thomas. on January 23, 2013, 11:29:19 pm
Please, could you add method FrameBuffer.blit(RGBColor col, int destX, int destY, int width, int height, boolean transparent)? This should be much faster than blit 8*8 white texture with additional color.
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: EgonOlsen on January 24, 2013, 10:26:45 am
Why should that be any faster? It's the same basic operation of rendering a quad... ???
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: Thomas. on January 24, 2013, 11:19:24 am
I suppose, when is blitted texture with additional color, to every pixel of texture is added additional color, so on 1280*720 it is a lot of extra calculations... But I do not know what is hiding in the background.
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: EgonOlsen on January 24, 2013, 12:34:17 pm
On PowerVR this has no effect at all. On Mali and Tegra it's faster if you omit the texture and render the color only, but that's only noticable in a very artifical test case when you blit 100 times the same texture filling the whole screen. And why would you want to do that? A clear with some color would be much faster anyway...
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: Thomas. on January 24, 2013, 12:55:53 pm
It is for menu. Everything are blitted with using colors, there are not needed any textures. How big differences are in speed?
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: EgonOlsen on January 24, 2013, 12:59:23 pm
When filling the screen (1280*800) on the Nexus 7 100times, it's half as fast when using the texture access then without it. But as said, that's a stupid test case. Nobody would do that and no menu would come even close to these numbers...
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: Thomas. on January 24, 2013, 01:12:57 pm
Well, so I try optimize my code sometime in the future (fps drops down from 60 to 55 when is editor menu visible)... Thank you for testing ;)
Title: Re: FrameBuffer.blit(RGBColor...)
Post by: EgonOlsen on January 24, 2013, 01:19:29 pm
If it ever becomes a problem, i can still try to detect your special case and optimize the shader for it, but i don't think that this will ever be needed. The drop you see comes from the additional rendering and state switches and such, not from the lack if fill rate.