DeepTexel for Unreal Engine 5

Textures that keep their detail as the camera gets close. Where the view magnifies a texture beyond its real resolution, DeepTexel builds new, finer detail on the GPU from the texture's own finer regions (fractal self-similarity), up to 1,024 times its real resolution, only where you look, and blends it in seamlessly.

No AI model, no extra art, no network: each texture needs one small detail pack (about 2 MB), generated in the editor with a right-click in under a second.

Requirements

Quick start: the sample map

  1. Enable Support UV From Hit Results (above) and restart the editor.
  2. Open Plugins > DeepTexel Content > Samples > FractalDetail_Sample and press Play. (If the Content Browser shows no Plugins folder: its Settings > Show Plugin Content.)
  3. Fly with WASD + mouse (E/Q up and down), or roll the mouse wheel to move towards whatever is at the centre of the screen. Speed follows the distance to the surface, so you can glide right up to the mosaic or the stone block. Press F to switch the detail off and on to compare. The top-left shows the magnification and the detail status.

The sample shows both ways to use the plugin:

Adding DeepTexel to your own mesh

  1. Generate the texture's pack. In the Content Browser, right-click the texture > Generate DeepTexel Pack. A <Texture>_DetailPack asset appears next to it. (Several textures can be selected at once.)
  2. Use the material function. In the mesh's material, where the texture is sampled, put MF_FractalDetail instead:
  3. UV input: the mesh's UV0 (a TextureCoordinate node, index 0, no tiling).
  4. Texture input: the texture, as a Texture Object (parameter or node).
  5. Color output: linear colour. Connect it to Base Color (lit) or Emissive (unlit), or into whatever the texture fed before. Samples/Materials/M_FractalDetail_Lit is a complete example.
  6. Add the component. Add a DeepTexel component to the actor and set its Texture (the same texture) and Pack (its pack). If the actor has several meshes, the first static mesh is used; call SetTargetMesh to choose another, and set Material Index if the material is not slot 0.

That's all. Play, and move close to the mesh.

Reference

DeepTexel component

Property Default Meaning
Texture The texture to add detail to (the one the material shows).
Pack Its detail pack.
Build Pack If Missing on Without a pack, build one when it first activates (a short hitch).
Material Index 0 The material slot using MF_FractalDetail.
Fractal Enabled on Switch the effect on and off at runtime.
Screen Wipe 0 Comparison split: detail only right of this screen position (0..1).
Performance
Activate Magnification 0.25 GPU resources are made once the view magnifies the texture this much (1 = real resolution).
Idle Seconds 10 ... and freed after this long without being looked at.
GPU Budget Ms 2.0 GPU time per frame for building detail (measured; the work adapts to it). 0 = fixed Ops Per Frame.
Ops Per Frame 8 Dispatches per frame before the first measurement, or always if GPU Budget Ms is 0.
Max Ops Per Frame 64 Upper limit per frame.
Sample Step 2 Match density: 2 = smoother, steadier edges; 4 = about 2.5x faster.
Look
Edge Protect 0.7 Keep clean straight edges and corners free of copied texture (0..1).
Deep Strength 1.3 Detail strength from the second level on (paintings ~1.3, photos ~1.0).
Detail Decay 1.0 Detail per level relative to the level above (photos ~0.9).
Detail Color 0.4 How much of the copied detail's colour to keep (photos ~0.2).
State (read only)
Status What the component is doing, or what is wrong.
Magnification Screen pixels per real texture pixel at the screen centre.

Blueprint: IsDetailReady() is true once every level the current view needs has been built and faded in.

AFractalPicture

A framed picture: set Picture (texture) and Width, and on its Detail component the Pack. Uses the unlit M_FractalDetail, so it shows the texture's exact colours.

Console variables

Variable Default Meaning
FractalDetail.MaxActive 2 How many components may hold GPU resources at once; the least recently viewed is released first.
FractalDetail.MaxSlowdown 20 If the GPU builds detail this many times slower than an RTX 5080, the effect switches off for the session (0 = never).
FractalDetail.Debug 0 Log what each component sees at the screen centre, about once a second.
FractalDetail.TestShot Testing: save a screenshot here once the view's detail is complete.
FractalDetail.TestQuit 0 Testing: quit after the test screenshot.

Log category: LogFractalDetail (activation, each level built with its GPU cost, release).

Performance and memory

Measured on an RTX 5080 at 1080p:

Limitations

Troubleshooting

Status / symptom Fix
"enable Project Settings > ... Support UV From Hit Results" Turn it on and restart the editor.
"inactive (not close enough yet)" Move closer (see Activate Magnification).
Surface disappears when very close Lower the Near Clip Plane (see Requirements).
"pack made for a W x H texture, image is ..." The texture changed: regenerate its pack.
"off: GPU too slow for fractal detail" See FractalDetail.MaxSlowdown.
"waiting: FractalDetail.MaxActive components are all in view" Raise FractalDetail.MaxActive if you have the GPU memory.
Nothing happens, no status FractalDetail.Debug 1 logs what the centre ray hits (the mesh needs collision).
"fractal detail needs Shader Model 6" Project Settings > Platforms > Windows: DX12 and SM6.

How it works

When the camera magnifies a texture beyond its real resolution, the component builds the next 2x level of a 1024 x 1024 patch around the point at the screen centre, and keeps going a level at a time as you get closer (up to 10 levels). For each small patch of the upscaled image it searches the texture's own example patches (320,000 of them, at two scales and in eight orientations, clustered into 1,024 groups by the detail pack) for the one whose surroundings match best, and copies that example's fine detail, scaled to the local contrast. Back-projection makes sure that shrinking the result gives back the original pixels exactly, so detail never changes what the texture looks like from further away. The same spot always gets the same detail.

Credits

Sample photos, both CC0 (public domain dedication), from Wikimedia Commons:

Support

Email universe@kportal.net with your engine version, GPU, and the component's Status or the LogFractalDetail lines from the log.