Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPOILER] Backgrounds drawn with the mbg command appear slightly corrupted [SPOILER] #168

Open
drojf opened this issue Mar 17, 2022 · 0 comments

Comments

@drojf
Copy link
Contributor

drojf commented Mar 17, 2022

why does this cg have random black stuff near the top left corner? is this normal?
SPOILER_unknown

closeup
unknown

Image garden_se1a is drawn with

mcl a,0
mbg black,22
mbg garden_Se1a,8

me:

it looks like the "black" pixels are just any pixel in the image which has the same value as the top left pixel
that's why there are also some random other pixels which are black
the game engine has a special mode where it uses the top left pixel as the transparent color (like a green-screen)
and in this special case they've drawn the background with a different function than normal which uses this mode
I know how to fix it but I probably won't in case it breaks something, but thanks for letting us know about this issue
I'll make a record of it on github

To fix this issue, you can either

  • As per the nscript reference, add c to the image processing tags https://07th-mod.github.io/ponscripter-fork/api/#lsp eg
    • stralias garden_Se1a,":b;bmp\background\garden\garden_se1a.png" becomes
    • stralias garden_Se1a,":bc;bmp\background\garden\garden_se1a.png"
    • Don't just blindly apply this to all background images - while most images in the background folder don't have alpha, the images in the efe folder do have alpha (and possibly someother images).
  • Add an alpha channel to all images (these bg images are all RGB not RGBA). I think the engine will automatically use for alpha images

I dont think I'll actually fix it though, because the artifacting is small and this only happens when background is not drawn with the bg command, plus some other conditions.


O[A] mentioned there is a flag called force-png-alpha , see here for more details: https://07th-mod.github.io/ponscripter-fork/#/?id=image-transparency . However I'm worried turning it on might break anything which relies on this behavior, like the below image (I haven't tested whether it would actually be afffected though - the specific tag for the image would probably overrule the force-png-alpha)

pri_efe
stralias PRI_efe,":ba;bmp\background\subway\pri_efe.png" ;地下牢 格子スプライト

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant