CustomShapeButton icon indicating copy to clipboard operation
CustomShapeButton copied to clipboard

Engine crashes when using a texture with high resolution

Open MikeStavri opened this issue 1 year ago • 1 comments

So i was using the plugin and i had set all the textures correctly with the correct parameters but the engine kept crashing with this error: [UnrealEditor CustomShape Button!SCustomShape Button::UpdateRawColors_Texture'::2'::<lambda_1>::operator()() [D:\UnrealProjects\CustomShapeButtonSample_UE5-4\Plugins\CustomShapeButton\Source\CustomShapeButton\Private\SCustomShapeButton.cpp:240] UnrealEditor_CustomShapeButton!UE::Core::Private::Function::TFunctionRefCaller<SCustomShapeButton::UpdateRawColors_Texture'::2'::<lambda_1>,void __cdecl(FRHICommandL]

After a lot of testing i have figured out that the problem was that the texture resolution was too high(1080x1080). I have fixed the issue by resizing the texture to 256x256. I figured i should post this in case someone else had the same issue with this plugin and also because this wasn't mentioned in the documentation.

MikeStavri avatar May 11 '24 10:05 MikeStavri

Hello, I cannot reproduce your crash with this image of 4166x4164 size that I randomly found on the web: 4k-button

  • Video - where set up this 4k image from scratch for the Sample Project from Releases page

You can download this sample from the video with my 4k button and check if it crashes for you.

If samples (both CookedGame and Project) don't crash for you, I suspect it might be something with your image setup. Then check next:

  1. Make sure the texture has proper settings. Refer to Step 3A from doc. A crash might occur if your heavy texture was unloaded by the engine to free up resources, so make sure 'Never Stream' is enabled.
  2. It would be worth verifying if the Image Size from the Style matches the actual texture size. Refer to Step 4B from doc.
  3. If your image is corrupted or its size is not divisible by 2, the engine might crash. Try my 4k image from the video: link

JanSeliv avatar May 11 '24 15:05 JanSeliv

Hey, thank you so much for the response, and sorry for taking so long to reply, but I was working on other parts of my project and I forgot about it.

I tried your suggestions and I found that one of my textures had 'Never stream' to false. Also, I didn't match the 'Image size' to my texture's resolution. The crash was pretty uncommon and it hasn't happened since.

MikeStavri avatar Jun 09 '24 18:06 MikeStavri