Jump to content

Aliasing when shadow filter is applied


Michael B
 Share

Recommended Posts

I'm seeing some significant aliasing artifacts when a DropShadowFilter is applied to a sprite, unless cacheAsBitmap=true. Normally wouldn't be a problem as I'd just cache it as a bitmap, however I'm seeing some display bugs related to using it.

1) has cacheAsBitmap=false, no shadows

2) has cacheAsBitmap=true, drop shadow

3) has cacheAsBitmap=false, drop shadow

Am I doing something wrong or do I need to do my own shadows?

 

Screenshot (4).png

Screenshot (3).png

Screenshot (2).png

Link to comment
Share on other sites

antialiasing works only for main framebuffer. Any filter, renderTexture will ruin it and its webgl problem, not pixi. In WebGL2 its possible to use AA on created framebuffers but pixi-v5 doesnt support that yet.

Well, if scale is near 1 you can try adding a transparent frame around the card for the texture.

Another approach is to photoshop your shadows into PNG files and use extra sprites to show them, and its fastest approach.

Link to comment
Share on other sites

yep I'm also using renderTexture to draw the card background here as the cards are transparent.

I'll try creating a png just for the shadow itself and see how that goes, otherwise create new card assets with baked in shadows (less ideal, I'd have to have different sprite sets then).

Link to comment
Share on other sites

as a side note, is it a known issue that when using cacheAsBitmap sprites could end up not rendered? I chased this for hours, sometimes my sprites are just invisible when it's enabled randomly (but frequent). I couldn't locate any specific bug of my own, and it doesn't happen at all when it's false.

Link to comment
Share on other sites

Its difficult part of code ,it had many bugs and i think there are still many left. I recommend study how it works and use getBounds() renderTextures and other stuff like removing sprite from parent before caching to udnerstand why its difficult.

I have custom caching for filters that takes care of very huge stages from big collection of SWF files and i still have bugs in it :)  I will publish it in summer maybe.

Welcome to hell.

Link to comment
Share on other sites

yea I remember talking with you a bit about it before and sounded like a tough problem to solve. Maybe I'll find time to contribute, I haven't even looked at the v5 source yet as I'm still using v4.

The prebaked shadows looked pretty good, so I can turn off bitmap caching and just go with that as a solution.

Thanks!

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...