Documents

Is it need to make Texture LODs?

UE4 automatically make mipmaps for your textures. If you import 1024 texture to engine it’s automatically creates 512,256,128,64,32,16,8,4,2,1 size textures from the original texture data. These are stored as mipmaps for original texture and it cost +33% more texture memory. When texture is sampled at material, pixel shader calculates what size mipmap it should sample. This automatic mipmapping prevents aliasing and saves a lot of texture memory bandwith. There is also texture streaming feature that only loads mipmap levels that are needed for object. If object is really far a way engine does not need to load the full size texture but small version of it. Let say 64x64 texture.

Original Text: Texture Size LODs
https://forums.unrealengine.com/development-discussion/rendering/1445698-texture-size-lods

UE4 Texture settings help (Mip Gen Settings, LOD Bias, Power of Two Mode)
https://polycount.com/discussion/200525/ue4-texture-settings-help-mip-gen-settings-lod-bias-power-of-two-mode

Comprehensive

Lifecycle of a Texture in Unreal Engine for Virtual Production

Texture Streaming

UE4 Texture Optimization Tutorial - How to use Mipmaps and Texture Streaming in Unreal Engine 4
https://www.youtube.com/watch?v=Tq1TSccLyiU

[TUTORIAL] Unreal Engine - How to optimize texture resolution
https://www.youtube.com/watch?v=p2YPcWETiG8

[UE4] Think about how to determine the Texture Streaming Pool Size
https://qiita.com/EGJ-Nori_Shinoyama/items/cc959d201ff011df872f

[UE4] About texture memory
https://qiita.com/com04/items/cea6da4949fc8774fcb8

[UE4] Impact of Texture Group on Texture Streaming
https://qiita.com/EGJ-Nori_Shinoyama/items/8b3c2e4e372f05e33476

Q: How to set Streaming PoolSize for starting up application?
A: Modify \Engine\Config\ConsoleVariables.ini, add r.Streaming.PoolSize=2000 under [Startup].
Reference:
https://answers.unrealengine.com/questions/343646/texture-streaming-pool-over.html
https://answers.unrealengine.com/questions/172853/how-do-i-increase-the-texture-pool.html

Q: What’s non-streaming texture?
A: Without respecting the power of 2 rule.
Reference:
https://answers.unrealengine.com/questions/574012/non-streaming-texture-over-4000-mb.html

Q: How to change streaming pool size?
A: At the console: r.Streaming.PoolSize=150 or make the change permanent by editing your DefaultEngine.ini to include:

[/Script/Engine.RendererSettings]
r.Streaming.PoolSize=1500

Reference:
https://answers.unrealengine.com/questions/172853/view.html

Parallax Occlusion Mapping

Bump Offset and Parallax Occlusion Mapping - UE4 Materials 101 - Episode 8
https://www.youtube.com/watch?v=wc0StMr3CQo

[UE4] Parallax Occlusion Tutorial
https://www.youtube.com/watch?v=4lF9H8JEQck

UE4 Parallax Occlusion Mapping Tutorial
https://www.artstation.com/artwork/XBnL3l

Parallax Occlusion Mapping
https://nerivec.github.io/old-ue4-wiki/pages/parallax-occlusion-mapping.html

Relief Mapping

RM-Methods adds many Methods of Relief Mapping beyond the actual POM shader on Unreal Engine. The plugin can generate an special Texture Map to use on the shaders.
https://www.unrealengine.com/marketplace/en-US/product/rm-methods

Detail Textures

Adding Detail Textures
https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/HowTo/DetailTexturing/index.html

Mipmap

[UE4] How to make a custom Mipmap
https://qiita.com/EGJ-Osamu_Saito/items/a8c9015ecb3db3cc86db

Q: Why can’t modify Mip Gen Settings?
A: If you are not using a power of 2 texture you will get the NoMipmaps and will not be able to select any other options from the drop-down or adjust the LOD Bias.

Origin:
https://answers.unrealengine.com/questions/351241/impossible-to-change-mip-gen-settings.html

Editor Notes

How to set Texture Size

Texture Editor -> Compression -> Maximum Texture Size.
Default value 0 means the maximum size for the format on each platform.

Texture Settings

Texture Support and Settings
https://docs.unrealengine.com/en-US/Engine/Content/Types/Textures/SupportAndSettings/index.html

Programming Notes

How to save Texture2D to image file (e.g. .jpg; .png) using C++

Use UImageWriteBlueprintLibrary::ExportToDisk, example: CompositingElementOutputs.cpp

Reference:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/76797-how-to-save-utexture2d-to-png-file

How to generate mipmap for dynamic Texture 2D

Solution:

UCanvasRenderTarget2D::bAutoGenerateMips = true;

No mipmap support for Dynamic Texture 2D https://answers.unrealengine.com/questions/424643/no-mipmap-support-for-dynamic-2d-texture.html

How to change LODBias at runtime

C++ code:

if(UTexture2D* Tex = GetTexture())
{
    Tex->LODBias = LODBias;
    Tex->UpdateCachedLODBias();
}

Cosole command:

r.mipmaplodbias 0
How to get list of textures from a material
virtual void UMaterialInterface::GetUsedTextures
(
    TArray< UTexture * > & OutTextures,
    EMaterialQualityLevel::Type QualityLevel,
    bool bAllQualityLevels,
    ERHIFeatureLevel::Type FeatureLevel,
    bool bAllFeatureLevels
) const

https://answers.unrealengine.com/questions/470467/get-list-of-textures-from-a-material.html?sort=oldest

Reference

Texture Streaming
https://docs.unrealengine.com/en-us/Engine/Content/Types/Textures/Streaming

Texture Streaming Configuration
https://docs.unrealengine.com/en-US/Engine/Content/Types/Textures/Streaming/Config/index.html

Virtual Texturing | Live from HQ | Inside Unreal
https://www.youtube.com/watch?v=fhoZ2qMAfa4

The Render to Texture Blueprint is a tool that has several different texture baking functions built in. It makes use of the editor’s ability to save high resolution screenshots including visualization buffers such as base color and world normal.
https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/RenderToTextureTools/

Plugins & Tools

Load Texture

Runtime Image Loader, Load images into Unreal at runtime without hitches
https://www.unrealengine.com/marketplace/en-US/product/runtime-image-loader


极度渴望成功的人并不多,愿付非凡代价的人更少。----美团王兴