Jump to content

Scaling & Blur


JustMe
 Share

Recommended Posts

Hello all... new to Pixi.js, love what I have seen sofar!

 

Surprised at how easy it was to set pixi.js up the first thing I tested for myself was the scaling part...

and... it scaled!   \o/

 

unfortunately it blurred aswell!

 

Could anyone tell me if you can adjust this manually like you could for canvas?

ctx.imageSmoothingEnabled       = false;
ctx.webkitImageSmoothingEnabled = false;
ctx.mozImageSmoothingEnabled    = false;

 

If pixi already provide this.. I was unable to locate the answer on the forums/docs.

 

 

 

Please keep up the great work pixi!

 

Thanks for reading.

Link to comment
Share on other sites

Unfortunately it does not provide unfiltered scaling yet :(

 

Everything scales linearly by default (or bicubic for canvas), that there is no way to change it to nearest neighbor scaling built in. I have been hacking in a solution until an official one is released.

Link to comment
Share on other sites

I'm working on a patch right now that I am about to submit, allowing you to set a filter parameter on a per-texture basis.

 

Ah yes! I was thinking I could have a renderer parameter? smooth true/false keep it nice and simple

 

Looking forward to this!  Thanks for the response :D

A small followup question; now I have no knowledge about anything related to the GPU... (or math for that matter :P ) is/can this scaling be done by the GPU or will this always be a CPU task?

 

Thanks!

Link to comment
Share on other sites

When using WebGL, it will be a GPU task. When using Canvas it will be a CPU task (not 100% sure on that).

 

*EDIT*

 

Submitted:

 

https://github.com/GoodBoyDigital/pixi.js/pull/167

 

nice! 

is it you're not 100% about canvas because even though webGL is not supported for drawing it could still use the GPU for calculations?

Also the link you added, is that a suggestion awaiting approval or an actual update?

 

sorry for the newbee questions!

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...