blitting text and images

Started by raft, March 30, 2010, 04:02:41 PM

Previous topic - Next topic

raft

maybe. the outer part is not fixed in size, it's scaled according to inner text part.

btw, seems as texure's arent needed to be added to TextureManager for blitting. they are uploaded at first use i suppose ? how can i dispose them ?

EgonOlsen

In desktop jPCT, you can do this via the TextureManager. In AE, you can't. I guess, i somehow missed that part in the porting...i'll add it.

raft

great :) i wasn't even aware of TextureManager.unload.. method. you must have added it while i wasnt on the scene i guess..

i would expect uploading a new texture and modifying it with a texture effect perform almost the same, right ?

EgonOlsen

Not quite. Modifying will always be cheaper, because it removes some gl overhead that the creation of a new texture will cause. It might not be that much though.

raft

Quote from: raft
instead of character blitting, i can render each bubble's text to a texture and blit it. this is what i do in desktop karga except it's java2d not blitting. this will dramatically reduce number of blits in cost of texture creation

yeap, this doubled the performance on emulator ;D
http://www.aptalkarga.com/tmp/B1.apk

EgonOlsen

Up to 26 fps now on the phone. I'll try to improve blitting speed somewhat anyway.

dl.zerocool

Nice to see you guys working on better solutions, as always, you can ask for tests (Since that's the only help I can provide atm.)
I'm working on the project so feel free to ask.


raft

@dl.zerocool
feel free to try the app above and paste the results ;D

paulscode

#23
Quote from: raft on March 31, 2010, 12:48:33 PMi would expect uploading a new texture and modifying it with a texture effect perform almost the same, right ?

Quote from: EgonOlsen on March 31, 2010, 12:58:02 PM
Not quite. Modifying will always be cheaper, because it removes some gl overhead that the creation of a new texture will cause. It might not be that much though.

When I was working on my "video texture" project, I found that the overhead of adding new textures was significantly more than modifying existing textures (to the point that the first option was not really an option if you want smooth video playback).

-- I haven't tested if this is still true for JPCT-AE though.

raft

Quote from: paulscode
When I was working on my "video texture" project, I found that the overhead of adding new textures was significantly more than modifying existing textures (to the point that the first option was not really an option if you want smooth video playback).

but i suppose you were doing this every frame ? in my case this is done once per bubble. indeed every time font size changes for each bubble but on Android font size wont change

dl.zerocool

Quote from: raft on March 31, 2010, 04:25:13 PM
@dl.zerocool
feel free to try the app above and paste the results ;D

First since I don't know what your application is doing, I only see few bubbles with text.

Next, when loading it start at 40fps and then go to 60fps and stay at 60fps.
Some time after the bubbles start disappearing gently to let the black screen alone, always at 60fps of course.

And stop animation from menu does nothing.


raft

Quote from: dl.zerocool
First since I don't know what your application is doing, I only see few bubbles with text.

ehm ;D it's an image and text blitting test application, and hence the bubbles. you can hit center key to add more bubbles. and as you noticed they disappear after some time.

QuoteNext, when loading it start at 40fps and then go to 60fps and stay at 60fps.

same thing with animation, dalvik somehow warms up, good for us :D

QuoteSome time after the bubbles start disappearing gently to let the black screen alone, always at 60fps of course.

60fps with and without bubbles, i suppose there is vsync or something which limits fps.

and nevermind the menu, "copy paste is the mother of all evil" ;D

dl.zerocool

Quote from: raft on March 31, 2010, 06:16:34 PM

ehm ;D it's an image and text blitting test application, and hence the bubbles. you can hit center key to add more bubbles. and as you noticed they disappear after some time.
Sorry I don't understand what "blitting" means, I'm living in Switzerland and my mothers tongue is French, even I also speak Portuguese, English, German(school level) :) and learning Japanese.

Quote
and nevermind the menu, "copy paste is the mother of all evil" ;D
Ahah I do know this very well...
---
"Last week we had to "play" program few small trains with train station in real. (It was to prove our understanding about threads using the pthread lib).
And I spent 45minutes why my TrainA was not doing is stops and the TrainB suddenly stop itself when it was not needed.
Each train has is own thread and I did a copy paste at start to not having to rewrite the all thing... Well it was a bad idea since i copied TrainStop(B); everywhere... on the A thread."
---
Now about A1.
If I add bubbles the fps drop under 60 fps
with 14 bubbles ~43fps
with 18 bubbles ~38fps
and as soon as they start disappearing it goes back to 60fps.

anther thing is that when you leave the application (home for exemple) then go back in, there's no more bubbles, only text appear. (same fps as with bubbles)

moving arround with the pad don't make any changes on fps. Or so few that's not visible.

raft

Quote from: dl.zerocool
Sorry I don't understand what "blitting" means..
blitting is something like pasting 2d image or text on top of rendered scene

QuoteAnd I spent 45minutes why my TrainA was not doing is stops and the TrainB suddenly stop itself when it was not needed...
hehe, yeap such things happens all the time..

QuoteNow about A1.
thanks for the tests. did you download A1.apk B1.apk ?

Quoteanther thing is that when you leave the application (home for exemple) then go back in, there's no more bubbles, only text appear. (same fps as with bubbles)
i suppose that happens because some textures are lost when GL surface is recreated. that should be handled in a regular application

dl.zerocool

Quote from: raft on March 31, 2010, 06:59:25 PM
QuoteNow about A1.
thanks for the tests. did you download A1.apk B1.apk ?
Thanks for the explanation.
I downloaded B1.apk, but the software name is A1, sorry for the confusion.