Texture 2d shows wrong colors from jpeg on HTML5 package
Hi friends!! I am working to load jpeg files from origin server. I want use this files to make a Texture2D and put this on static mesh component.
My code is a combination of C++ class and a blueprint child of this:
The code runs perfect in the UE4 Editor!! In the image you can see the result. The left mesh has got a texture charge with UE4Editor, and the right mesh it's charged from code:
But, when I package the project on HTML5. I see this:
The web console and debug console don't show error messages. I think that it's a adjustment properties problem in UTexture2D but when I try edit this the web browser throws an error.
Thanks for your attention!!
Ok Guys!!! I have solved my problem. I think it's a HTML5 packaging bug. When I was trying to run the project launcher the UE4 code changes the order of RGB components to BGR. I solved the problem with a personal function. This function read the components of "uncompressed RGBA", they are saved on TArray and they are loaded to texture from TArray . Now I see the blue rose in UE4 Editor and the red rose in HTML5 XD.
This is my code now:
And thanks to Rama (https://answers.unrealengine.com/questions/33571/fimageutilscreatetexture2d-causes-brief-hang-is-th.html) I use TextureFromImage
Maybe it's a problem in Unreal Engine to fix in future releases.
answered Jun 05 '15 at 04:32 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here