Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 10:47 am
All times are UTC + 0
Canvas optimizer
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [13 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Jun 19, 2014 11:15 am    Post subject:  Canvas optimizer
Subject description: also batch conversion capable
Reply with quote  Mark this post and the followings unread

Since too big canvases need unnecessary amount of RAM during rendering ingame, it would be nice to have a tool that optimizes the canvas.

When using the tool, it should shrink the canvas to the smallest possible size, while every colored pixel on all frames are still kept visible.
During this it should of course keep the object centered.
e.g. shadows tend to go to the right side, while the left is empty. In this case the left can't be made smaller than the right or the object would be misaligned ingame.

It would be also nice if there is an option, to reduce the canvas size only to multiple of 48 (or 60 for RA2) as usual canvas sizes are
48x48
96x96
144x144 etc and combinations like 48x96


And then of course a batch conversion to do this on multiple files at once would be nice.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Thu Jun 19, 2014 11:35 am    Post subject: Reply with quote  Mark this post and the followings unread

It would be handy for sure but I am not sure on the memory allocation as basicly the game loads them into memory as files directly and then draws from them accordingly and it does use actual canvas limitation in actual stored frame to draw while I presumed basic logic that it uses the full dimension always but what point would there be to draw the blank area (outside of canvas cut stored frame), surely Westwood wasn't that dumb?

What I asked around, most seem to think its merely drawing the internal frame and does not allocate any more memory than what the SHP loaded took as file.

Actual multiples in size is not necessarily relevant (just tidy convention) as stored frame is always canvas cutted to weird dimensions of non multiples if you look up shp headers.

Admittedly I also preach doing this trimming while I am not sure it makes difference or not, actual filesizes are not affected given SHP has its internal canvas cut compression for the excess blank while internal canvas frame background blank is then handled by RLE (C3)

Plus I suggested to Banshee ages ago to do a frame trimmer tool but still nothing...

If shp has 50 frames and you want it halfed, it would delete every 2nd frame to smoothen potentially too slow animation.

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Jun 19, 2014 12:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

i heard from AlexB, Hyper (or another exe pro, don't know anymore), that the game renders/handles SHPs ingame as if they are BMPs, which means they need the space to store the complete canvas and not only for the visible part.

And thus the canvas optimization should help reducing needed RAM and maybe improve performance when lots of SHPs are rendered at the same time.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Thu Jun 19, 2014 12:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Back in 1999, this might have been a problem, but the games code is quite good at handling the SHP's once loaded, but not perfect.

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Thu Jun 19, 2014 12:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, I would frankly like if someone of the 'exe pros' would finally conclusively put the issue at rest as any inside views so far from them are surfaceful...

Until then we're left assuming if its optimal or it isn't and doing things based on guess, maybe performance difference is minimal by today standards but nonetheless...

I've asked the same pros over the years and frankly it hasn't gone further than comment that it doesn't use more memory than what the RAM loaded shp as file took to draw it.

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Jun 19, 2014 9:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
it would be nice to have a tool that optimizes the canvas.


When you save an SHP file with OS SHP Builder or even other programs like XCC Mixer, the program does optimize the canvas before storing its pixels in the file. I think it did that since version 1.0 of BS SHP Builder.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Bittah Commander
Defense Minister


Joined: 21 May 2003
Location: The Netherlands

PostPosted: Thu Jun 19, 2014 9:40 pm    Post subject: Reply with quote  Mark this post and the followings unread

What LKO means is that there should be a function to automatically make the canvas smaller when there's a lot of free space around the object in the center.

_________________

Back to top
View user's profile Send private message Send e-mail ModDB Profile ID YouTube User URL Facebook Profile URL
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Jun 19, 2014 9:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

correct,

imagine a 800x600 pixel big SHP with only a tiny 1x1 building in the center. On such an SHP you could reduce the canvas from 800x600 down to only 48x48.

In the past i've seen quite a lot of SHPer to release SHPs right how they came out of their renderer. And usually they render the images in 320x240, 640x480 etc, the default settings in 3dsmax or other 3d programs.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Jun 19, 2014 11:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

I do understand what you mean, but I don't necessarily agree with it.

I know that it would be useful to automatically resize down the canvas size to whatever is useful in a image generated by a renderer. The problem is the automatic part of it. I can't simply suppose that any image that is imported by the program comes from a render, nor that the user shall not paint the currently unpainted pixels around it.

The frame trimmer tool seems to be viable. I just couldn't be bothered to code it yet and OS SHP Builder is not my priority at the moment, due to the bad situation of my thesis proposal.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Jun 20, 2014 6:14 am    Post subject: Reply with quote  Mark this post and the followings unread

No, not automatically always.
What i mean is a new option in the menu: "optimize canvas" which then makes the canvas as small as possible.
And another option "batch conversion" inside the "optimize canvas" menu, which allows to do this on multiple files.



SHPBuilderMenu.png
 Description:
 Filesize:  11.27 KB
 Viewed:  4558 Time(s)

SHPBuilderMenu.png



_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri Jun 20, 2014 1:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

That sounds feasible. I'll do it whenever possible.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Aro
Alcohol Fueled


Joined: 10 Sep 2006

PostPosted: Fri Jun 20, 2014 1:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes please. I'd be grateful for this feature. Smile

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Fri Jun 20, 2014 2:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yea, it could come handy like how the Crop section works in VXLSE.

_________________
"If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [13 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1795s ][ Queries: 14 (0.0117s) ][ Debug on ]