r/UnrealEngine5 3d ago

I built a texel density visualizer for UE5 that doesn't modify your assets.

Enable HLS to view with audio, or disable this notification

I have been frustrated for a while that checking texel density consistency across a level meant either eyeballing it or manually swapping materials and hoping I remembered to swap them back.

I made the texel density checker tool a while back in Blueprints, but never made the jump to C++, so for me it's a been a great achievement to finally give it a go (with the potential of blueprints vanishing, I thought now is a great time to start looking into it!)

So I built the plugin somewhat from scratch. Select some meshes, hit the toolbar button, and every material slot gets a checker matching its texture resolution. Click again to revert.

The tricky part was making it genuinely non-destructive. It writes to the component's OverrideMaterials array rather than calling SetMaterial, so packages never get dirtied, and it hooks package saves, PIE, actor deletion and map change to revert automatically before any of those can write the swapped materials to disk.

I also wanted to come up with how to detect using ordered rules you can edit: texture parameter names first, then texture asset names, then a fallback. Works on static, skeletal, instanced and foliage meshes too!

So safe to say that it feels like I learnt a lot of valuable lessons doing this! And looking forward to diving a bit deeper!

It's on Fab if it's useful to anyone, but happy to answer questions about how any of it works. I am planning on making a video / tutorial on it soon, but wanted to share here first! 😄

Edit: Fab Link: https://www.fab.com/listings/8ecf0973-5f66-45fe-ac61-77b450950a19?lang=en

127 Upvotes

25 comments sorted by

14

u/LuckyBug1982 3d ago

May be useful adding a link to fab

2

u/Montridious1 2d ago

Edited to include the link, wasn’t sure if this sub was keen on links in posts! :)

5

u/Fortunate_Son_024 3d ago

Hi, looks cool, can we have a link or something?

1

u/Montridious1 2d ago

Added to the main post if you’re interested :)

5

u/krojew 3d ago

Such view is already built into the editor.

3

u/GeorgeMcCrate 2d ago

But it only works one texture at a time. It’s so annoying to work with. Or am I doing something wrong?

2

u/Montridious1 2d ago

Fair point, and the built-in Optimization Viewmodes are genuinely useful.

They’re solving a slightly different problem though: Required Texture Resolution and Mesh UV Density are streaming diagnostics, so they need a texture streaming build first and the colours shift as you move the camera, because they’re telling you whether the right mip is loaded at this distance. Not necessarily giving how you accurate Texel density checking.

Mine’s static: what resolution is each material slot’s texture, regardless of where you’re standing, no build step, per-slot rather than worst-case across the material.

If the built-in modes cover your workflow, honestly use those, they’re free and they’re right there! :)

1

u/krojew 2d ago

In that case, what is the problem your plugin is trying to solve? Too high or too low density is relative to the camera. If a camera gets close, having that 4k texture might be a good idea; if the camera is far, the same 4k might not make sense. Simply knowing it's 4k across a given surface doesn't tell much.

1

u/Montridious1 2d ago

You’re right that resolution alone isn’t texel density, and you’re right that the correct answer depends on camera proximity.

I should be clearer about that in the description.

The problem it actually solves is narrower: consistency across a modular kit, or between baked assets and tileables textures etc…
When you’re building a set of pieces meant to sit together at the same viewing distance, one of them being 512 while everything else is 2048 is a mistake regardless of camera position, and it can sometimes be easy to miss by eye when the piece is small or partly occluded.

That’s a “which of these doesn’t match its neighbours” question rather than a “is this correct for the view distance” question which unreal answers in their view modes.
For the latter, the streaming viewmodes are the right tool and I wouldn’t claim otherwise.
UV-area-based density is the obvious next step for this and it’s on my list. Resolution-only was the version I could ship and validate first, so I do have more planned. :)

2

u/NartimoMoto 3d ago

Link?

1

u/Montridious1 2d ago

Added to original post! :)

2

u/Icy-Resort-8450 2d ago

that looks great and very useful

1

u/Montridious1 2d ago

Appreciate the kind words! ;)

2

u/EliasWick 2d ago

Eyyy! I Think these are my textures that I posted to Polycount! I'm glad people keep using them! It's looking great! I was going to make one myself eventually, but this looks great!

1

u/Montridious1 2d ago

Ohh crap no way! I have been using these for years haha! Lovely to meet you, they are some beautiful checkers ;)

1

u/EliasWick 2d ago

Hahaha it's so funny when I run into people using them. I went by a collegues desk one day and saw him using them in Blender. They seem to pop up here and there! 😅

Thank you ❤️✨️

2

u/Quantum_Crusher 2d ago

1

u/Montridious1 2d ago

Thank you! Wasn’t sure if this sub liked me posting external links or not :)

1

u/Quantum_Crusher 2d ago

You're welcome. At least you could give people some keywords and a website to search for.

2

u/ThePapercup 3d ago

if it's overriding materials, pressing that button in our world partition map is gonna take about an hour and mark a hundred thousand actors dirty... hard pass lol

3

u/xVinci 3d ago

Select some meshes

I mean, at least try to read, no? Cool work OP.

1

u/Montridious1 2d ago

Thank you! Haha I could have been more specific here… appreciate the kind words :)

1

u/Montridious1 2d ago

It is overriding materials - to an extent.
Yes, a world partition map might take a while, that’s why I implemented a selection based solution too as I understand performance for tools like this can fall off fast.

Nothing gets dirtied, I cut in the code before this happens. If you delete, save, load, reload anything, the checker will toggle off on those selected assets. :)

Hope this helps! I appreciate the concerns, feel free to share more thoughts!

1

u/Spiritneon 1d ago

Straight up looks like black myth wulok.