The ONLY texture a game NEEDS [UE4, valid for UE5]

preview_player
Показать описание
It this video we go through a tech art experiment: can I texture an asset by using just one texture?
How that would look like and what how the shader should be to make it into a fully fledged material?

This is essentially an unconventional incipit to discover few tips and tricks to do cool stuff like deriving a Normal map from an Height map, learn how Colour Picking is done and how to manipulate gradients with math, to some extent.

======================================================

Рекомендации по теме
Комментарии
Автор

"the normal map is very important! lets scrap it"

proper game development right there

DFAT
Автор

Your artifacts aren't coming from texture compression. They're coming from sampling immediate neighbors. You can sample more neighbors or just slide your points out so that the hardware texture filtering samples more points for you. And you're doing a heck of a lot of work to arrive at the built-in normalize node. Just normalize the vector after you scale it.

falkreon
Автор

The thing is that the normal creation works very inconsistently well and you are basically reverting back to CrazyBump times
What looks good on a bark might look really bad on a brick. This makes sense if you don't have normal maps available otherwise all these operations will just cost more performance but less memory

ShrikeGFX
Автор

Wow!
I only was doing this with two textures.
First texture I put a difusse (rgb) and roughess (alpha)
Second texture I use a normal map compresed in two channels (r, g) and derive z normal from this two vectors. And I put ambient oclusion in the blue channel and displacement in the alpha.
Incredible with one texture!! Thanks a lot!

fernandodiaz
Автор

Wow, you clearly know a lot about shader programming. Well done. I've never seen a tutorial like this :) Liked and Subbed.

TorQueMoD
Автор

A cool approach to experiment. Though this technique is inefficient and also can't be used for a lot of surface to represent.
You are basically following the old Photoshop process of creating textures for materials using Albedo. That approach is nice but will never produce better result. Also Because you are calculating them in shader instead of using Textures, it can be calculation heavy. I feel the trade off is not worth it. Also for the Normal, You can use a more detailed Height map and then process it with the mesh normals to get a more accurate detail normal.

SumitDasSD
Автор

big fan of your channel sir. was thinking of a wayout to have simplified props and character shaders for metahuman and megascans. found a thing to keep in minds. brilliant

YourSandbox
Автор

I love watching videos about optimization. I make games for phones and try to have the best graphics so I need this kind of stuff

DARK_AMBIGUOUS
Автор

Should be titled "How to unnecessarily hyper complicate a shading process to achieve a similar result in an unoptimized way"
or
"How to have 10x shading complexity and bottleneck instead of 1x memory bottleneck"
Brilliant 👍

MehrdadGTa
Автор

"Speaking of which, would you like to explore more the world of photogrammetry" while moving camera around the object with the chunky mouse movement 👍 I like it

schrottiyhd
Автор

Adding an alpha channel doubles the amount of space and memory, because unreal uses 16 bit for textures with alpha.

Also, in photogrammetry, the normal and height are not derived directly from color, but from the 3d point cloud generated from hundreds of images. Regardless, this is a super fun exercise.
The best idea for textures like this is to do two samples
Basecolor, and normal. Because the blue channel is not needed in normal, you can put AO, height or roughness in there. Common technique is to put height into normal, and then have the AoRM texture. Still 3 texture samples, but not so much more space. Alternatively, if you care less about samples, you could do basecolor, then have height, ao and roughness in a second texture. Same amount of memory as your technique!

Stepping issue is due to precision and sample distance, not compression I think. Compression would have larger blocks with smooth details in them.

albarnie
Автор

Virtual Textures/lightmaps/shadows are there to not have the Vram issue, doing that is transferring one issue (who does not exist that much anymore) to an other (number of instructions), that being said I think it's a very interesting approach!
I would completely consider that kind of solutions if I wanted to have a very very light project with tones of reused assets using the same textures set everywhere :) !

EXpMiNi
Автор

Since it is a grayscale texture ( and normal Maps only need two channels) I'd create a proper normal map from the texture. Then put grayscale texture in the third Channel and use an alpha for roughness and metallicity. That would give the dimensional normal effect without compromise and still have a single texture. even more efficient would be to use a single gray scale image for the texture and then a constant variable for roughness and metalicity.

WoodysAR
Автор

Every interesting! Could be really useful for stylized/mobile games.

Thank you for video!

saisnice
Автор

I use a texture format called "ARM" which is 3 textures inside one.
Ambient occlusion = Red channel
Roughness = Green channel
Metalness (or use for different mask if material is not metallic) = Blue channel.
This reduces the amount of textures from 3 to 1 and simply uses RGB values.

I use ARM textures almost everywhere because they save a lot of memory and still look really good.
And because they still can provide a lot of material information or since their unused channels (such as metallic) can be used for various types of masks they can be used for many things.

Also you can reduce the amount of texture samplers by setting the sampler nodes to "shared wrapped" mode.
If you then sample the same texture multiple times it's seen as 1 sample.

C_Corpze
Автор

Your videos are amazing, pure usefull content

cocinandod
Автор

What you built is a very specific shader for a very specific case. You sacrificed alpha and roughness because you didn't need them in this case. But it makes the shader useless for any other texture that needs them. For example, roughness may not match the albedo.

AllExistence
Автор

The issue with moving the height map into the alpha channel of the albedo map is that the alpha channel is generally uncompressed, meaning it takes up as much memory as the RGB channels combined. You're better off having two RGB textures than one RGBA texture.

Catequil
Автор

I could see a simpler and more performance-friendly version of this being really great for adding small, low resolution models for finer detail, but for more prominent models such as characters, buildings, major set pieces, etc. it would be better to have all the real textures. I think it is more practical to combine things like roughness, height, metallic, into a second texture, and use a separate normal and color map. This gives you three textures as opposed to 5, and is typically much better looking than pulling from 1 texture as you get all the benefits of PBR graphics, with the smaller memory footprint of less textures, but less shader math than your method.

While I agree that many modern developers tend to waste performance on poorly compressed textures and using many B/W maps to achieve what could be a single texture, it is important to remember that these "extra" maps exist for a reason, and that reason is to simulate the tiny changes in a surface based on real materials, rather than the older method of just approximating everything with fake or baked-in texture trickery. These tiny surface details cannot truly be achieved for most assets with a technique like this.

TriVoxel
Автор

Interesting. Was not thinking that calculating textures in memory would be better then sampling a texture ... but it makes sense. Unfortunately i would not want to loose roughness textures. But would it be good to use the same textures across multiple materials? If for example i have a the same roughness texture i put on multiple materials. Currently i use AO, Roughness and Metal in one RGB texture for a material. But would it be a benefit to split this and reuse the same Roughness texture across materials?

scrcrow