Git Product home page Git Product logo

Comments (12)

ffreality avatar ffreality commented on June 25, 2024 1

For runtime usage I created two functions.

1- TextureRenderTarget
2- UTexture2D

UTexture2D will only supports B8G8R8A8. I can't access compressed buffers such as DXT.
TextureRenderTarget and Widget renderer can access DXT ones but they are have some kind blured view.
So, I will create a bug report for it.

Runtime imported textures are not problem because generally they imported as TransientTexture with PF_B8G8R8A8 format.
If you imported your texture to editor, you have to be sure if they are PF_B8G8R8A8 or not.
If they not, you have to set

Texture Group as UI
MipGen Settings as NoMipMaps
CompressionSettings as UserInterface2D

from Texture's settings.

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

There are two possible scenarios in here
1- I changed image buffer reading method to wider compression support but there are lots of them. So there is a chance for unsupported compressions left.

So, I need you to send me your image and compression settings. You can just bring your cursor on your texture and screenshot when there is a pop up appears.

Runtime imported UTexture2Ds are Transient B8G8R8A8 so I am sure they will work.

2- When we talk about error handlings, I added some validations to image and u3d functions. I didn't have time to test it but I thought 0 means success (because 0 means successful for file saving for LibHaru standarts). If I thought wrong, image adding won't continue correctly and create black square instead.

Else we know that images works. As you remember I sent you a sample PDF for Cyrillic alphabet support and at the bottom there was an Android icon image from Unreal Engine's Engine directory.

from ff_libharu.

F1nansist avatar F1nansist commented on June 25, 2024

In editor adding images work correct but in packaged build it doest work properly.

I made some tests in packaged game. Add image returns TRUE but i have black square.

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

Okay.
FImageUtils::GetTexture2DSourceImage is an editor only function. Let me change it.
I really liked that function and felt cheated. I need to go to the theraphy.

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

Okay changed it and tried with packaged, it works. Just let me try with another image.
//
Only B8G8R8A8 compression works. Need to work on that.

from ff_libharu.

F1nansist avatar F1nansist commented on June 25, 2024

If u use image which is multiply 4, unreal will compress it up to DXT1/5 and u loose somehow B8G8R8A8

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

Done but images comes blury

from ff_libharu.

F1nansist avatar F1nansist commented on June 25, 2024

What do u mean?

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

Reading non-BGRA8 is really pain in the bottom. So, I created a Texture Render Target 2D and draw texture as material on it. After that I read its raw data. It works both editor and packaged but it isn't sharp. it looks like low resolution.

from ff_libharu.

F1nansist avatar F1nansist commented on June 25, 2024

If u import texture which sides dont power of two Unreal doesnt generate mipmaps btw. And how I said before if image sides dont multiply of 4 Unreal will not compress it to DXT. Compressing decrease memory usage of texture without quality loss, but in our case we need native RGBA8 without compression

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

Whatever Unreal's behavior is we need BGRA8 without compression.
As you can see on the source code, I exposed Target Image as UObject. So, you can attach both UTexture2D or TextureRenderTarget2D.

If you want to use TextureRenderTarget2D, you have three option
1- You can use it with ScreenCapture2D and insert captured scene
2- You can use our ExtendedVars blueprint and create UTextureRenderTarget2D from Widgets
3- You can draw material on UTextureRenderTarget2D

This option can insert non-BGRA8 UTexture2Ds but they come with some blur and Epic should save them.

If you want to use UTexture2D in packaged runtime, it has to be BGRA8. Editor doesn't have that limitation. I added FImageUtils::GetTexture2DSourceImage(Texture2D, Image); in #ifdef WITH_EDITOR

If any one can help me about DXT1 to 5 uncompression, I can integrate it.

from ff_libharu.

ffreality avatar ffreality commented on June 25, 2024

I created another issue for DXT texture insertion. We can talk about possible solution on there.
https://github.com/FF-Projects-UE/UE_LibHaru/issues/5

from ff_libharu.

Related Issues (5)

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.