Git Product home page Git Product logo

Comments (14)

GValiente avatar GValiente commented on September 3, 2024

With the "bpp_mode" field you can override default BPP mode for all graphic asset types (sprites one was missing, I have just added support for it).

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

I'm not sure to understand. I have a bg with "bpp_mode": "bpp_8" with a palette > 16 colors but using only < 16 colors in that palette, and, once imported, its palette is 16 colors (without using "palette_item" option, because, if you do that, it's ok).

Edit: Maybe, it is because in my palette, many colors are the same. I have to check.

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

graphics.zip
Just tried with those files.

bn::regular_bg_ptr bg = bn::regular_bg_items::test_256c_all_diff.create_bg(0, 0);
bn::bg_palette_ptr palette=bg.palette();
bn::span<const bn::color> colors_const = palette.colors();
BN_LOG("test_256c_all_diff palette size: ", colors_const.size());

bg = bn::regular_bg_items::test_18c_all_same.create_bg(0, 0);
palette=bg.palette();
colors_const = palette.colors();
BN_LOG("test_18c_all_same palette size: ", colors_const.size());

I got:

[WARN] GBA Debug:	test_256c_all_diff palette size: 16
[WARN] GBA Debug:	test_18c_all_same palette size: 16

256c_all_diff and 18c_all_same refers to the number of colors in palettes, in the images, only one color is use anyway.

from butano.

GValiente avatar GValiente commented on September 3, 2024

I have updated the graphics tool to allow to specify colors count for almost all graphic asset types.

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

I tried but I still have the same behaviour with the files I provided. Am I missing something?

from butano.

GValiente avatar GValiente commented on September 3, 2024

Have you updated butano?

If it still doesn't work after updating (and specifying colors count in the json of the bmp you want to import), please upload a minimal reproducible example of the issue.

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

test.zip

I took the zip file of the project (In the main page, Code->Download ZIP).
I tried with the files and code I provided.
This is a full project.
I saw a difference, bpp is now BPP_8 but the color count is still not correct.

test_256c_all_diff : 256 colors in the palette, all the pixel use the same color "slot" (pure blue). Result in the log: [WARN] GBA Debug: test_256c_all_diff palette size: 16, bpp:1

test_18c_all_same: 18 colors in the palette, all the same (pure red), all the pixel use the same color "slot". Result in the log: [WARN] GBA Debug: test_18c_all_same palette size: 16, bpp:1

And to try to find how it works, I built test_256c_all_diff_gradient (which in fact has 255 colors in the palette) and use only few colors of it but more than 16 colors and I got:
[WARN] GBA Debug: test_256c_all_diff_gradient palette size: 240, bpp:1

I don't understand why there is 240 colors, I imagine some of the colors (15 of them??) in the palette are the same once converted to 15bit...

Hope this helps

from butano.

GValiente avatar GValiente commented on September 3, 2024

You have not specified "colors_count" field in the json of the affected bmp files.

from butano.

GValiente avatar GValiente commented on September 3, 2024

As I said, please make sure to update Butano and specify colors count in the json of the bmp you want to import.

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

Just tried and it seams to work. Sorry for the "colors_count" but it was not specified in the "Importing assets" doc page in the bg or sprite part (but indeed, it was in the palettes part). When you said "(and specifying colors count in the json of the bmp you want to import)", I thought you were talking about the bpp field...
I still have to see if it still merging colors which are the same in the image. I'll try tomorrow.
Thanks a lot. Your project is really great :)

from butano.

GValiente avatar GValiente commented on September 3, 2024

"colors_count" field shows in the sprites section, at least for me: https://gvaliente.github.io/butano/import.html#import_sprite

By the way, can I close this issue?

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

You're right, clearing the browser's caching, the text appears in the others sections 😕, sorry.
Can you wait I test if the identical colors in the image are still merged to use the same "palette slot" before closing it ? I don't think I would be able to do that today but I'll try tomorrow.

from butano.

GValiente avatar GValiente commented on September 3, 2024

I'll close this issue now.

If you have issues with palettes merging, since it is unrelated to this issue, please feel free to create a new one.

Here's a bit of extra info about color palettes, by the way: https://gvaliente.github.io/butano/faq.html#faq_color

from butano.

ultrasuperpingu avatar ultrasuperpingu commented on September 3, 2024

Ok, finally, I had time to test. It's working, it's great. Thanks.
Here is the result of what I was trying to achieve (WIP).
output1
output2

Thanks again

Edit: It's WIP, fade time is too short I guess. Not that obvious on mGBA...

from butano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.