Travis Posted October 7, 2013 Share Posted October 7, 2013 Say I make a 1x1 pixel white .png, then scale it to 50 px and use it as a sprite. Is that more or less efficient than using a 50x50 px sprite? This is specifically for Canvas/webGL Quote Link to comment Share on other sites More sharing options...
AshleyScirra Posted October 8, 2013 Share Posted October 8, 2013 The difference is probably negligible on a hardware-accelerated canvas/WebGL. The larger image will use more memory though, and the 1px image might have stretch artefacts (e.g. a gradient style edge). Generally there are much more important performance issues to worry about. Also on some systems it will take the CPU longer to issue the draw call to the GPU than it takes the GPU to complete the actual rendering. Quote Link to comment Share on other sites More sharing options...
Travis Posted October 8, 2013 Author Share Posted October 8, 2013 Thanks for the reply, Ashley! It was more of a question that was interesting vs something I was actually going to implement. As a side note, I <3 construct 2. It was the first program that I used when I was learning game dev. Quote Link to comment Share on other sites More sharing options...
Donna111 Posted October 12, 2013 Share Posted October 12, 2013 Hi thereI also want to know is there any free software which supports to scale image effectively? Quote Link to comment Share on other sites More sharing options...
AhmedElyamani Posted October 12, 2013 Share Posted October 12, 2013 I've used a software called Vector Magic to turn my bitmaps into vectors , then save them the size I want. Great tool. Quote Link to comment Share on other sites More sharing options...
AshleyScirra Posted October 16, 2013 Share Posted October 16, 2013 I think my original answer might be wrong when it comes to mobile actually! Some mobile devices have a very limited fill rate, and can only write every pixel on-screen 3-5 times a frame and still get 30 FPS. Usually you have to have at least one clear/background image every frame which doesn't leave you with very much. A sprite resized very large will use lots more fill rate than a small one. So you should probably avoid having lots of very large sprites on mobile. On desktop generally the GPUs can be so ridiculously powerful that the time it takes for the CPU to tell the GPU what to draw is longer than the time it takes the GPU to draw it, so there genuinely is no difference! rafinskipg 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.