It is currently 27 Apr 2024, 05:30
   
Text Size

Slow performance

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Slow performance

Postby DennisBergkamp » 18 Feb 2010, 20:57

Hmm, I'm still not convinced, what was the old way of blurring/resizing ?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby silly freak » 18 Feb 2010, 21:16

i think there was no blurring previously, but it looks really good. you can start a game and resize the picture panel to the 0.5 scale limit and compare with/-out blur. it really is a gain for small sizes. the configuration also seems very good

i think we just jeave it as it currently is until it makes problems
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Slow performance

Postby DennisBergkamp » 18 Feb 2010, 23:29

I see... but there's no way to do it the same way it was done originally?
It looked much better at first, I think. The small card images just looked completely smooth, now they're really jaggy. Or maybe this is just happening on my system?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby silly freak » 18 Feb 2010, 23:57

do you have a screen? it shouldn't look as crappy as previously any more, and I can't confirm they're "really jaggy"
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Slow performance

Postby DennisBergkamp » 19 Feb 2010, 07:37

Actually, in ImageCache.java if you change the radius int parameter value that's passed into getBlurredImage from 3 to 6, things look awesome again :)
I just hope this won't cause too bad of a slowdown.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby Huggybaby » 19 Feb 2010, 08:16

I don't know what kind of scaling algorithm you guys are using, but (if applicable) it's possible to provide the end user a selection from a variety of well known high speed varieties, and the code is readily available. See http://en.wikipedia.org/wiki/Pixel_art_ ... algorithms.
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: Slow performance

Postby Snacko » 19 Feb 2010, 09:46

Those NxSai and Hqnx filters work good only for pixel art, like the one used in the snes games plus they are designed to enlarge only. Also they're quite slow and need quite a beefy computer (as in any core2).

Personally for me at radius 6 it looks like a blurred mess but each to his own.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Slow performance

Postby DennisBergkamp » 19 Feb 2010, 18:08

Ok, I guess it's all personal preference then :)
Or perhaps it's system specific? On my computer 6 - 7 looks almost exactly the same it was the original way, using medium - large card sizes. 3 is just too jaggy (i'll post a screenshot).

I'll try to turn it into an menu option then ("blur radius"?), with values of something like 2 - 8.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby DennisBergkamp » 19 Feb 2010, 20:47

Also, using LQ pics will definitely turn the small sized pics into a blurry mess when using a radius of 6.
HQ pics look jaggy though.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby Snacko » 19 Feb 2010, 21:23

Yes, I haven't thought about HQ pics.
It is true that as the size increases the blur radius needs to increase as well to preserve the same relative blurriness.
~3 looks good for LQ and you need ~6-7 for HQ as you said

edit:
I've been testing scaling with a external library which does Lanczos scaling and the results are even better. However I'm not sure you want to make dependency on another jar.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Slow performance

Postby Huggybaby » 19 Feb 2010, 22:47

Please, make the dependency.
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: Slow performance

Postby DennisBergkamp » 19 Feb 2010, 23:03

How big is the Jar?
If it looks even better, it is probably worth it :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby Snacko » 20 Feb 2010, 14:05

It's like 40kB. I've also used a maven build of google collections which is a single jar, that's why I've removed jsr jar.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Slow performance

Postby DennisBergkamp » 20 Feb 2010, 19:15

Very cool, Lanczos3 looks beautiful (also for HQ images scaling) :mrgreen:
Definitely worth the 40kb in my opinion.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Slow performance

Postby DennisBergkamp » 20 Feb 2010, 19:27

Hmm, except, for some reason tapped images don't show anymore?
And performance seems pretty slow :(
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 97 guests


Who is online

In total there are 97 users online :: 0 registered, 0 hidden and 97 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 97 guests

Login Form