Page MenuHomeFeedback Tracker

setObjectTexture "Cannot load mipmap" error with UI on texture feature
New, NormalPublic

Description

When I'm using the setObjectTexture command to load an UI on a texture, that contains an custom image, I get an "Cannot load mipmap" error. This error only appears on the first usage of the command. Every additional update of the texture works as expected and shows the image.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Operating System Version
10.0.22621 Build 22621
Category
Ingame UI
Steps To Reproduce

Arma 3 v2.12.150330 (Profiling Branch)

Load a custom UI on the texture of an object with:

cursorObject setObjectTexture [1, "#(rgb,1024,1024,1)ui('AE3_ArmaOS_Main_Dialog_test','AE3_UiOnTexture')"];

Object class used: Land_Laptop_03_sand_F

Example UI class definition I used:

class AE3_ArmaOS_Main_Dialog_test
{
	idd = 15984;
	movingEnable = true; // allow moving window by dragging the element with: moving = true
	enableSimulation = true;
	class controls
	{
		class RscButton_1050: RscButton
		{
			// Battery Symbol
			idc = 1050;
			//text = "\a3\Data_f\Flags\flag_Altis_co.paa";
			text = "\z\ae3\addons\armaos\images\AE3_battery_0_percent.paa";
			x = 32 * GUI_GRID_W + GUI_GRID_X;
			y = 0 * GUI_GRID_H + GUI_GRID_Y;
			w = 2 * GUI_GRID_W;
			h = 2 * GUI_GRID_H;
			colorBackground[] = {0,0,0,0}; // transparent
			colorBackgroundActive[] = {0,0,0,0.2}; // darken
			colorText[] = {1,1,1,1}; // white; this could prohibit to change color to yellow and red on low battery levels, but is necessary for design changes
			style = ST_PICTURE + ST_KEEP_ASPECT_RATIO;
			action = "";
			tooltip = "";
		};
	};
};

Updating the texture with this command works and shows the image:

private _uiOnTextureDisplay = findDisplay "AE3_UiOnTexture";
displayUpdate _uiOnTextureDisplay;
Additional Information

My image is 256x256 pixels with transparencies. I created the paa file with the Image2PAA converter and also with the paa.gruppe-adler.de online converter. The result was the same, alsways shoing the error.

The error does not appear if I use this Arma 3 Image: \a3\Data_f\Flags\flag_Altis_co.paa

Event Timeline

y0014984 created this task.Mar 17 2023, 2:34 PM
y0014984 edited Steps To Reproduce. (Show Details)

PAA File


Original PNG

What happens if you change to (rgb,256,256,1)

What happens if you change to (rgb,256,256,1)

I have tested it. The error is the same. This resolution determines only the overall resolution of the UI on texture. My used image is smaller and only a small part of the complete texture. Therefore these resolutions does not need to be the same.

To fix this issue, display your texture in normal UI somewhere before using it inside ui2texture. I have the ticket about this exact issue @ https://feedback.bistudio.com/T170766

To fix this issue, display your texture in normal UI somewhere before using it inside ui2texture. I have the ticket about this exact issue @ https://feedback.bistudio.com/T170766

Thank you. I will try that.

y0014984 added a comment.EditedMar 31 2023, 9:37 AM

The UI2Texture fix in the latest profiling build 2.12.150430 does not solve my problem.

Preloading the UI is a valid workaround for this bug. In my example I preloaded the UI in a display and closed that display immediately afterwards. This seems to be fast enough so the player doesn't recognize the preloading:

private _tmpDisplay = findDisplay 46 createDisplay "AE3_ArmaOS_Main_Dialog";
_tmpDisplay closeDisplay 1;