07th-mod / umineko-question

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

drojf opened this issue · comments

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" ;地下牢 格子スプライト