Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.
It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.
About your First Question
Hey, you did a great job for your first your topic(s), I assume you did read our forum rules - thanks. But you should really avoid having more than one question in a topic, because things tend to become very hard to answer then and our answers very long (as evident by my answer here). Try to find a singular main question you have. You can then optionally ask thematically closely related follow-up questions once the main question has been answered.
Before we go here into details, I would recommend having a look at the topic Overlapping images with transparency with BaseBitmap as it is quite tangential to what you seem to be trying to do.
The general problem is that this "writing multiple layers with embedded alpha values" scenario is not something the Cinema Image API (BaseBitmap, MultipassBitmap) has been really geared for. The major use case for creating multiple layers with alpha values in the Cinema API, Bodypaint, is covered by cinema::PaintBitmap. But that is sort of its own eco-system. BaseBitmap and MultipassBitmap are meant for loading and displaying data.
The reasons why your code is likely not working, is because you do not write the master alpha of the multipass bitmap. That was also what I was struggling with in the other thread. You create the channel as auto rootAlpha = Bmp->AddAlpha(nullptr, COLORMODE::GRAYf); but never write to it. Probably in the assumption that this would happen automatically, but it does not.
That is probably due to the Maxon Image API image saver
maxon::ImageSaverClasses::TGA or generally the switch to the underlying Image API (
BaseBitmap::GetImageRef()) making some things snap into place there. You must understand that the Cinema API types BaseBitmap and MultipassBitmap are just a shallow wrapper for the underlying
Maxon Image API.
You could save into one of our in-memory
UrlSchemes, e.g., an MFS or Ramdisk, when it is the disk activity you fear. When you want to avoid the general overhead of having to serialize and deserialize the image, and want to stay in the Cinema Image API, you will probably have to curate your master alpha channel manually. Or just do what I did in the other thread and manually blend things. There are also some options in the Maxon Image API, but my answer is getting longer and longer ...
I don't think that this is true. Both BaseBitmap and the underlying ImageInterface (which you usually encounter as an ImageRef in code) support floating point image data. They are defined under the
Graphics label as maxon:Pix...
488d1756-bde6-4d17-8039-cb22fde0b916-image.png
They are largely correct but neither necessary nor the cause (not sure why you set MPBTYPE_SAVE to false though).
This topic is riddled a bit by too many questions. Let's try to take a more direct angle here and just try to solve what you are trying to do. I assume you want to have some form of UI that stacks multiple images with transparent areas, similar to what the Asset Browser is doing here to display overlay icons over its assets.
The Asset browser simply achieves this by drawing the images on top of each other via cinema::GeUserArea::DrawImageRef, i.e., it uses the Maxon Image API directly. Here you could also load in SVG data via maxon::VectorImageClasses if you wanted to. We also have specialized buffer handlers for pixel blending or you could manage a multi layer image in the Maxon Image API via maxon::ImageBaseInterface. But I would avoid these two latter options when possible.
Maybe you could describe what you want to achieve concretely?
Given the 32bit/float requirement, I assume you want to draw some texture tiles with some meta information superimposed on them? Please also try to share executable code with us, so that I have a starting point when I write a code example. Please also share demo data when necessary (e.g., an HDRI texture).
Cheers,
Ferdinand