Wow! I've been looking for a long time for a detailed tutorial about shaders, textures and their compression in UE.
@jaydenstorace32182 жыл бұрын
My man these lectures absolutely slap
@BIGTTSNORLAX4 жыл бұрын
Another awesome tutorial! You may be an old-pro at teaching this stuff, but I hope all the positivity coming in shows you how much we appreciate the excellent methodology you follow.
@BlondiniMagic4 жыл бұрын
Thank you Ben! I'm a newbie to UE4 and I've spent literally two days trying to figure out a texture blurriness problem. The answer was in your tutorial. My problem was that I hadn't checked the Compress Without Alpha box. Thank you! Thank you! Thank you! I'm looking forward to learning more from you!
@freakin_ghost2 жыл бұрын
man you saved me, all these days I am using default compression settings for all my texture maps and frustrated why the 3d models looks too shiny. after setting the compressions as you said, the 3d model looks amazing. thanks you so much.
@MigueldeAguirre4 жыл бұрын
Thank you very much for your detailed explanation. Now I understand much more those parameters and configurations that were like Egyptian cryptography to me.
@rossknowles56082 жыл бұрын
i have to say... ridiculously well made!
@ChrisEllerby4 жыл бұрын
Love the tutorial. Might be worth talking about the images before being imported, like what file format they should be for best results or art pipeline.
@Fafmagic4 жыл бұрын
Great explanation as usual. I’ve always skipped compression because I have a powerful GPU and make only small scale personal projects for video output, but this will be really useful for my students who sometimes work on underpowered laptops. Keep up the great work!
@dungeonmaster2173 жыл бұрын
ASMR texture made me chuckle.
@Omar.bin.khattab4 жыл бұрын
Perfect ... Thanks Ben ... Great job ... Thanks For Your Time .. With my Respect
@AdamJanz3D3 жыл бұрын
Fantastic video, Ben! Thank you so much for this great explanation of the settings. :-)
@liquaard28242 жыл бұрын
Notes - if quality issues with DXT1 , use BC7 - use greyscale if only 1 channel - for normal maps use DXT5
@michaelgarydean2 жыл бұрын
Great video, thanks. This really helped clarify the different compression modes.
@amatolihi4 жыл бұрын
Such an amazing tutorial! Thank you Ben!
@ooooolk4 жыл бұрын
Great videos! Going through all of them right now. extremely helpful, thank you for making them :) :)
@snook-official7 ай бұрын
Essential viewing, wish I'd watched this sooner
@animus37214 жыл бұрын
Phenomenal video, can use this setup for almost all my textures
@LoopSkaify4 жыл бұрын
I have q question: did you find a way to strip source content from .uassets? especially textures are huge. Some people in my project don't have the benefits of a fast and cheap internet connection like me and working with github and many thousand of large texture assets with their source art drains their internet volume quite a lot. Also to save disk space. The textures could take less then quarter the amount of space. Best regards.
@liquaard28242 жыл бұрын
quality is always important
@MIKELENZTIPS3 жыл бұрын
Super helpful 👏👏👏
@jamal_khan4 жыл бұрын
Thanks, this was very helpful.
@fracturedfantasy2 жыл бұрын
Question, you spoke about streaming method which was helpful - however, I have a texture that I have imported that is defaulting to "not streamed". How am I able to change the method in either case -> streamed vs. not streamed?
@fracturedfantasy2 жыл бұрын
I found the never stream option which allows me to swap it... perhaps that's the setting I'm looking for 😉
@BenCloward2 жыл бұрын
Yes - that's the one.
@Utopia2023Game2Ай бұрын
good job
@noisegrindercn Жыл бұрын
Great tutorial. I still have one question: Should ambient occlusion be sRGB? Unlike the roughness/metalness/specular, AO directly contributes to color though.
@BenCloward Жыл бұрын
Ambient occlusion is a multiplier for the ambient light in the scene. It's like a shadow for the ambient light just as cast shadows are for the direct light. It should be linear. I'm not sure what "directly contributes to color" means.
@noisegrindercn Жыл бұрын
@@BenCloward I thought AO was the direct multiplier for the surface Base Color since this is the method to apply shadow for most digital image painting/processing software. Guess the engine has handled it properly if it was passed to light properties. Now I can safely pack them with other linear channels. Thanks for clearing it up!
@BenCloward Жыл бұрын
@@noisegrindercn Glad I could help! Multiplying AO with the Base Color was the old fashioned way of doing it, but now most game engines treat it correctly. The old way wasn't good because it still darkened the material even when I light was shining directly at it.
@driftaaa Жыл бұрын
Question, I have four separate grayscale noise textures. I am trying to channel pack those texture into one texture in a material blueprint in UE 5. I can pack three of the noise textures into the RGB channels using Texture Sample and Param Mask nodes just fine. When I append the data from the fourth texture into the fourth (alpha) channel the data is not getting packed. Or at least nothing is showing in the alpha channel when I look at the packed texture in the UE5 editor. What am I missing in order to pack four textures into one via the material blueprints in unreal? FYI, I am intentionally trying to not use an external tool like Photoshop or Gimp...
@BenCloward Жыл бұрын
I'm not clear on what you're doing. Could you describe it a bit more? How do you use a material blueprint to pack a texture? And why are you trying to avoid using Photoshop?
@driftaaa Жыл бұрын
@@BenCloward It is a long story but I am rendering noise from a material directly to a render target texture. Then I am creating a static texture off of what was rendered to the render target. So since I was generating the texture(s) from various noise shaders to a render target I was trying to keep my entire workflow within Unreal. In short, I generated four different noise textures. I want to combine them into one packed texture using all four channels. I am using four texture sample nodes and four param mask nodes, then combining them into a float4 using an Append4 node. The result is passed into the emmisive input of the material. Three of the four texture are packing into the RGB but nothing is going into the Alpha channel.
@BenCloward Жыл бұрын
Does the target you’re rendering into support 4 channels?
@driftaaa Жыл бұрын
@@BenCloward I am using "Render Target Format: RTF RGBA8" (Format: B8G8R8A8). I am not sure if that is correct for what I am trying to do?
@driftaaa Жыл бұрын
I added the solution I found to this thread but I think it got deleted due to me adding the hyperlink. The solution was found in a thread on the Unreal forums "4-13-how-to-write-alpha-channel-when-rendering-to-rendertarget-from-blueprints/369548". Here are the steps I did in UE 5.1 Render Target setup: -Clear Color to R: 0.0, G: 0.0, B: 0.0, A: 1.0 -Render Target Format: RTF RGBA16f Material Setup: -Material Domain: Surface -Blend Mode: AlphaComposite -Shading Model: Unlit -Route RGB to Emissive color -Route inverse of our Alpha (OneMinus Node) to Opacity
@spectator594 жыл бұрын
Interesting video, thanks. How do Mipmap chains relate to LODs?
@BenCloward4 жыл бұрын
Mip maps are lods for textures. They don't really relate to each other. Mesh LOD switches are calculated and performed by the game engine. Mip map switches are calculated automatically by the graphics hardware.
@whovisionsCGI Жыл бұрын
I've got a 4k udim map that has a little sign with writing on it. In my cg software the sign letters render clear. In ue5 they look very low pixel quality and some of the writing is unreadable. How do I keep the same high quality in ue5.1?
@elijahgames1923 жыл бұрын
a texture i've got has no mipmaps and i can't uncheck the never stream option.
@Kinkoyaburi2 жыл бұрын
Does anyone know where the sampler went in UE5? I can't find it.
@kegsfx86034 ай бұрын
I have an exr with no alpha channel and am using HDR(RGB, no sRGB). While I wish to have no alpha, Unreal seems to create one upon import, and then compress Without Alpha not working. This is not an issue with other compression settings/formats, but it is 32bit HDR(RGB, no sRGB) that I need. Any reason behind this and/or anyway to fix for this unused alpha channel? Thank you :)
@indieheartbit2 жыл бұрын
Hi Ben. Can you help me with following problem: I have imported a greyscaled (displacement) texture (format jpeg) into UE5. When i set the compression setting to "displacement 8bit/16bit", i only get a white compressed texture. I know that you have'nt explained all compression settings. Would you mind helping me with that? (I use displacement textures from Quixel Bridge and tried the downloaded rgb8 version. Then i made a greyscaled 8bit version with GIMP. Both imported, but same result.)
@mihaililinov22273 жыл бұрын
Very clear and well presented video. I have a question about 2D sprites and textures. By default after importing a texture and using the unlit shader, Unreal renders the sprite lighter also when moving there is some blur and all of this is by default. I could check the sRGB, or increase the RGBCurve to 2.2 but overall what would you chose. The context is 2D game which has some environmental assets as 3D and will use lighting sporadically.
@t.8843 жыл бұрын
IT would intrest me More wich Texture Format itself should be used . Tga ,PNG ?
@MonsterJuiced3 жыл бұрын
Maybe I'm missing a trick but I haven't included a specular map in any of my materials because I thought roughness and metallic cancelled that out. Should I be using a specular map?
@BenCloward3 жыл бұрын
Because almost everything has a reflectance/specular value of 0.5, it’s ok to just leave this at the default setting. But the main thing you can use it for is specular occlusion - areas where the model would be reflecting itself rather than the environment. That’s what we’re using it for here. Not required, but can add a bit more realism by masking out reflections and highlights where they don’t belong.
@MonsterJuiced3 жыл бұрын
@@BenCloward oh that's brilliant! Thanks for the information. Stuff like this is invaluable to me really. Also I figured out the whole rain system issues and I really appreciate your ideas on that they did help. I ended up completely re-organising and reconfiguring the pipeline between the material functions. Works a treat! :)
@jesseg.33714 жыл бұрын
Unreal's Engine is so incredible.
@Neki2K12 жыл бұрын
helpful
@nobunaga85143 жыл бұрын
What about different file formats. I work with EXR files often and they are MASSIVE in memory.
@HiScore1014 жыл бұрын
Can someone link me a video or article that explains how to create ASMR files properly to use in this application. It would appreciated greatly :D
@BenCloward4 жыл бұрын
Are you interested in learning how to create the actual data - the occlusion, specular, metallic, and roughness maps, or do you need to know how to combine them together?
@MrZyprez4 жыл бұрын
@@BenCloward would be nice to know how to combine them together! :)
@meowyang48233 жыл бұрын
Do you have any relevant articles or videos?
@turalmemmedov36485 жыл бұрын
WOW, another amazing video, Thanks a lot and I have a questions again )) 1) About streaming, if I use same texture on 2 objects and one of them is in front of me, will the other object use higher mip of same texture? Or the objects uses multiple textures but every one of them uses some part of every trim sheet textures. What about in this case? Will texture use mips for far objects? (Hope I could explain my questions with my pure English) 2) When you use maskNoSRGB setting, it is double size of albedo. Is it only because of alpha maps or this compression setting will give us double size even we use 3 channel mask texture? 3) I remember that, in one master class of Epic game, the guy said that, it would be more efficient to use alpha map separate from alpha channel of albedo. 1st it will be less MB, 2nd we will more manupilation options because we will not effect albedo map. So if 3channel mask texture and separate grayscale texture will give us less MB with mask compression option, is there other benefit than getting less instruction when using one 4 channel mask texture then 2 textures? I could check the questions about MB myself but right now I have no PC to check it out. So sorry for dumb questions and thank you again taking time for answers. ))
@BenCloward5 жыл бұрын
1) Regarding streaming - higher mip maps are loaded into memory based on the instance of the object with the highest score. Each texture only exists in memory once, so if there are two objects that use the texture and one is close to the camera, the texture will load in the higher mips. However, there's a difference between mips being loaded in and mips being used. The object that is further away will not sample the higher mips. The texture sampler of the distant object will choose pixels from the lower mips of the texture, because it's smaller on the screen - even though the higher mips are loaded into memory and available. 2) The masks (NosRGB) setting will use DXT1 compression if the texture has 3 channels or it will use DXT5 compression if the texture has 4 channels. DXT5 is double the size of DXT1 because of the extra alpha channel data that it uses. 3) I disagree that using an alpha channel as a separate texture is more efficient - with one exception. In the shader, texture samples are one of the most costly things to do, so having fewer texture samples is better. If the albedo and alpha are a single texture, you can sample both of them with a single texture sample rather than using two samples. If you have an albedo texture using DXT1 and an alpha texture using DXT1, that uses the same amount of texture memory as a single DXT5 texture with albedo and alpha together. The exception to this is if you can make one of the two textures a lower resolution. For example, if you need you albedo texture to be 2048, but you only need the alpha to be 256 - that would be a case where you would probably want to make them separate. In general, we try to use fewer textures overall and pack single channel textures together to reduce the number of texture samples required by the shaders.
@turalmemmedov36485 жыл бұрын
@@BenCloward Huge thanks for answers. I cant wait for next tutorial. ))
You're not really mentioning tho that Unreal Engine will use different compression types depending on the RHI Also Im not so sure BC7 will actually work without changing any project settings: forums.unrealengine.com/development-discussion/rendering/1588711-texture-with-bc7-compression-is-same-file-size-as-uncompressed-can-t-get-bc7-compression-to-work I think what you're looking at when just setting BC7 with a project using default settings is actually uncompressed, BC7 is supposed to give the same texture file size as DXT1 (However it will only work on DX11 enabled devices as well as give slightly slower load times)
@BenCloward4 жыл бұрын
Here are some more details about how BC7 is working: - My source texture (uncompressed) is 4096x4096 and is 64 MBs. - Unreal indicates that the BC7 compressed version is ~22 MBs So it's about a 4 to 1 compression ratio. This is double the size of a DXT1 (Default) and matches the size of a DXT5 (Default with alpha). These results are correct and working as expected. Notice here on the documentation from Microsoft (docs.microsoft.com/en-us/windows/win32/direct3d11/texture-block-compression-in-direct3d-11) that it indicates that the "Bytes per 4x4 pixel block" are 8 for BC1 (same as DXT1), but 16 for BC7. So you'd expect a BC7 texture to be twice the size of a DXT1 texture. I haven't changed platform project settings or RHI - so this is working "out-of-the-box" for me. You are correct that not all platforms support BC7. It was introduced with DirectX 11, so 10 year-old graphics cards won't support it, PS3 and Xbox 360 won't support it, and I imagine that most mobile devices probably don't support it. In those cases, Unreal will pick a format that most closely matches and is best for each platform.
@olliveraira61224 жыл бұрын
@@BenCloward Thanks for this :) I read about DC7 supposedly having the same file size on some reddit page so its likely not accurate.
@remasteredretropcgames33124 жыл бұрын
@@BenCloward I wish i could FORCE it to not use texture compression in older titles.
@torgath50883 жыл бұрын
ASMR texture? :-) It's called "Gentle Whispering".
@kathoden4 жыл бұрын
Why call it ASMR when MARS exists
@TaylorDaleWright4 жыл бұрын
It sounds like the Alpha channel is the least likely to be damaged by compression, so we put the most important/distinct info there, which is Roughness. Also, game dev work is hard, so sometimes we need some ASMR to calm us down, and this is a helpful reminder.
@Johnny_Nodes4 жыл бұрын
Dtxt1 is a 5,6,5,8 compression, so if youre packing masks, you really shouldn't be putting specular textures into the green channel as he describes, the green channel is the least compressed of the RGB channels. Since the AO is more likely to have gradients (Which are handled worse by compressions) you should really putting it into green. Red and blue should have things that are closer to masks (for instance metal maps) because they get compressed the most
@Johnny_Nodes4 жыл бұрын
a decent packing setup would be something like MARZ (Metal, Ambient Occlusion, Roughness, Height)
@BenCloward4 жыл бұрын
I respectfully disagree. As Taylor said, roughness is the most important map of the four. The blue channel gets chewed up the most by compression and the alpha gets changed the least. I recommend putting roughness in the alpha.
@Johnny_Nodes4 жыл бұрын
@@BenCloward I will also do the same :) I dont agree that as a blanket statement roughness is the most important texture to be packed there. I'm worried less about which channel gets compressed more, but also; in which of those channels is compression most harming the end result. If my roughness map is quite noisy and has a lot of pixel variation, my argument would be that the compression on it is less noticeable by virtue of the fact we don't have big gradients. Whereas on a heightmap or ambient occlusion I would worry more about banding. (In the heightmaps case, less when used as a displacement but more as a blending texture).