Home Unreal Engine

UE4 compressing textures??

polycounter lvl 10
Offline / Send Message
melviso polycounter lvl 10
Okay so I have a 1024 texture tiled twice on a 319cm square mesh. Using 1cm to 8px.  But the texture is looking heavily compressed compared to how it looks in my original 3d app. It looks even worse with normal map added. So is there a way to uncompress the texture in ue4?

I am using .tga file format. Is there a setting to uncompress textures in ue4?

Replies

  • Joost
    Offline / Send Message
    Joost polycount sponsor
    The default compression shouldn't be that bad. I wouldn't recommend using uncompressed textures. Can you show an example? Maybe you have your engine scalability settings set to low? (settings -> engine scalability settings) Normal maps should be set to normal map compression.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    The only time texture compression in UE4 was ever an issue to me was when I was using super clean textures with very little variation and subtle details. But you can avoid that by blending textures in the material editor. There's other ways to work around compression, so some example screen shots would help. 
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    https://docs.unrealengine.com/latest/INT/Engine/Content/Types/Textures/Properties/Interface/

    There should be a drop down with the word TC_Default under a compression setting. I don't know off hand what is available there but there may be a TC_Uncompressed or Editor UI or Vector Displacement setting. Those should be fairly uncompressed. However if there is a TC_BC7 that should have little to no noticeable artifacting.

    You may be noticing something else however like poor Mip Mapping or Texture Filtering. If the above steps don't work post a picture of the artifacts. 
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the replies, guys. I switched to using .psd files. Textures look a bit little better now. Also switched streaming poolside to 4096.
    One quick question, if I make a modification to the engine using the console log. Like say I add r. tonemapper film using the console log. Do I have to add these modification everytime I open the project unless I add them to the defaultengine.ini in the project folder? I read it here:
    https://docs.unrealengine.com/latest/INT/Platforms/Mobile/PostProcessEffects/
    or is this meant for mobile platforms cause I am using a pc and it's only for archviz stuff?

    Also having some issues with tessellation, I am wondering if this is due to the height mask resolution? or I need to subdivide the floor more?



    I used the material setup here:
    https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/MaterialNodes/1_12/

    Project is still very WIP. I still don't like the way the textures look close up.Looks really bad. I am using a 1024 texture now tiled 3 times for the dimensions I gave above or is 8px to 1cm not enough? On second thought, I think I should have just modeled the tiles but how would you go about uvmapping the modeled tiles for lightmap?




  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    WIP, got it to look better. Still needs more refinement. I am definitely going to look into modeling the tiles instead.


    If anyone knows why the tessellation won't increase further to make up for the jagged edges, pls kindly let me know. I am wondering if it may be a gpu limitation? I am using a Gerforce gtx 780m.
    EDIT: Tessellation solved. The floor needed more subdivision. For anyone having the problem, you can check the details here;
    https://answers.unrealengine.com/questions/152849/world-displacement-tessellation-not-work-correct-w.html



  • Neox
    Offline / Send Message
    Neox godlike master sticky
    how close will you be to those tiles in the final product?
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Some shots will be close like this vid:
    https://www.youtube.com/watch?v=UwEuSxAEXPA
    I wonder how he got the textures to look that good up close. I am guessing 32px to 1cm for texel density. But also it seems depth of field played a role in bluring the textures closer to the camera. I think he used some sort of bluring effect to make the textures look more natural. I know of the r.tonemapper post process effects but I am not sure that does the trick.
    The tiles in the video are definitely modeled?
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I doubt that those tiles are done with displacement. More like polygons, but maybe not even that. Its kinda hard to tell, but if you ask me, displacement would be the last thing that I would try when its some flat tiles. Have you tried POM? Even that would be much more efficient. 

    To increase tessellation density, you can use a mesh that is pre-subdivided. Or you can set the adaptive tessellation density in the project settings\rendering. But still, this is a really bad way to make tiles\bricks pop.

    About the pixel density: 
    You could layer up several tiling materials in a layered materials, and blend them with masks. Or aa 2 or 4k texture set plus some detail textures.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks Obscura

    That's the process I was using, with tiled textures and mask and it still looked bad. Is there a way a mask can be blured in the material editor(blur node)?  I think I need to look at the engine scalability again.
    Seems the normals look better with an ao applied and better roughness map. Kinda new to the whole pbr thing. I have been using Corona a6 and Blender cycles for cgwork.
    Btw, roughness map- white is rough/matte while black is smooth/highly reflective for ue4, right? Gets confusing from using specular/gloss maps.
    Will also try the POM.

  • ZacD
    Offline / Send Message
    ZacD ngon master
    The way I remember roughness vs glossy is that they are values from 0 (black) to 1 (white), for roughness and glossy the higher the value the more rough or glossy it gets, respectively. So a completely white roughness map is rough, and a completely white gloss texture is glossy. 
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Most of the blurring techniques - real time and non real time as well - are iterative. What this means is it need to do some math X times. So either you can put the same math X times in the material editor with the nodes or you can just use the custom node and make a "for loop". In short, there is no blur node, and you are better pre-blurring your mask because of multiple reasons. First, you would need to know the formula of the blurring technique that you want. Secondly , as its iteration based, it can get real expensive if not used carefully. Third, a real time solution is needed only if you would want to change its intensity in real time, or when you would need multiple intensity levels at the same time, like in a depth of field effect.

  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    @ ZackD     Thanks for explaining it, :). I think with Corona A6, glossy maps are - white is smooth reflection, black is glossy/rough. At 1.0- smooth reflection, 0-rough.
    It's a little confusing with the physically based shading but I think I am getting the hang of it. Another question about using the console log. If I entered a setting using it. For example, I enter r.tonemapper film= 1. I noticed after closing and opening ue4. I have to enter it again into the console log. Is there a way to make this work everytime I open the project?

    @ Obscura    Thanks for the explanation. Will use photoshop for bluring before importing the mask texture :)


  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    You can make it working all the time but only in game. Go to the level blueprint, and put "execute console command" node on event begin play, and type in your console command into that node. 

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Actually you can make it working in the editor too. There is a config file. ConsoleVariables.ini

    Find that file in your Unreal Engine install location, and type your console command to the end of that file, and save it. 
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks. Is there a way to make this modification on a project basis? Like in the Unreal projects folder? Maybe copy the consolevariables.ini to the config folder in the project folder?
    The reason I am asking is because Koola has a free project in the marketplace called Lightroominteriordaylight and the project comes with the r.tonemapper 1 and r.tonemapper shapen 1 settings in the editor. So I am wondering how he set it up so that anyone downloading the project, opens the level with these settings as default.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Floor bricks are definitely looking better. Tried the POM:
    With POM:

    With plain normal maps.


    But for some reason, it doesn't look realistic and I think its because of the soft shadows and lighting the bevel edges of the bricks will pick up from the scene lighting. I will have to give the modeled bricks a go and see how it looks compared to these. I think the tiles in the koola vid I posted were modeled as the beveled edges catch the lighting perfectly. There are also texture stretches at the sides of the bricks. Also modeling the bricks means less geometry than using tessellation.
    I feel like I am wasting too much time on floor bricks but I want to do it properly and make sure it looks perfect because I will also be rendering out stills from the project. Animation wise, it would be hard to spot these flaws with the camera moving showing the property.

  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Modeled bricks

    Defintely looks better. Needs chipping, irregularity and wear at the edges, probably cracks too. This means sculpting the tiles to get those details in. The image below is the reference I am using. Baking a normal map for the whole floor would mean a high res map. Maybe try tileable normal/displacement texture using a sculpting software. I think a sculpted baked normal map with a bump offset might do the job with all the details I need. Currently studying the materials in the ue4 starter map. Will try these next. Pls, any suggesttion, advice or insight is greatly welcomed.
    Thanks :).



  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I think you should reduce and contrast the roughness some. See how it still shows some glossiness on that top down reference? 
    I believe, from here, its not really (though even that is still not quite there, you miss the small chamfers on the edges) the shape of the bricks but more like the surfacing/shading. You should play around with the roughness, and normals.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the observation, obscura. I just pluged in a constant of 1 into the roughness slot. Main focus was the bricks shape and lighting. Will be doing a new roughness map after sculpting. The bricks were chamfered but I made them quite thin (notice the slight texture stretches at the edges of the bricks. Probably should have made them larger). It was merely a test to see how they compare to the previous method especially with lighting, bounces and shadows and how good the texture looks close up compared to before.
     Like you pointed out, it comes down to the normals and roughness which is why a sculpted tiled texture would be the ideal choice to get the brick shape as well as details properly.
    Coming from an offline renderer, ue4 does present some workflow differences.
    I watched this vid from gdc:
    https://www.youtube.com/watch?v=clakekAHQx0
    The assets they made from photogamentry have specular maps. If I remember from the ue4 documentation. isn't the specular supposed to be left at the default vaule? That artists should resist using spec maps and only concentrate on roughness for physically correct reflections?

  • Joopson
    Offline / Send Message
    Joopson quad damage
    This link explains the specular input in UE4 a little:
    https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/MaterialNodes/1_3/


    Essentially, it's a cavity input. (Or, curvature). It can give darker or brighter specular reflections within a certain range. Default is .5 (which I believe is 4% reflection) But it's not at all like a traditional specular map, and isn't necessary to get nice looking materials.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Yeah, I read that before. Thanks for the explanation. I guess it's there to give the artists some sort of control if needed.
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    To quote @somedoggy

    "TLDR; The Specular input handles what percentage of light gets reflected. That percentage only goes between 0% and 8%. It has no effect on metals, and modifying it in a non-physical way is probably not what you want. Composite Texture + Material AO works on metals and does the same thing artists think the cavity map hack does but physically based and far superior in quality."
  • ActionDawg
    Offline / Send Message
    ActionDawg greentooth
    Hi! I wanted to share a bit more of the math to make sure it's clear what's happening.

    So UE4 uses range of 0-1 for specular which gets multiplied by 0.08, and as previously stated this only gets used for nonmetals. So the default Specular of 0.5 gives you 0.04 aka 4% specular reflection for dielectrics.

    The reasoning is because this is based on Schlick's approximation where n1 = 1.0 (air)  and n2 = your material's IOR. The default is 4% because most real nonmetal materials have an IOR of about 1.5, and doing the above approximation with 1.5 you get: ((1-1.5) / (1+1.5)) ^2 = 0.04.

    Thus the range of 0 -> 0.5 -> 1 in the specular slot gives you a reflection coefficient of 0% -> 4% -> 8%, or an IOR range of 1 -> 1.5 -> 1.78879. Really quite a lot of range if you look at any list of real world IORs.

    So essentially, I'd recommend touching it only as a last resort after properly configuring your Composite Textures and Material AO, or if you really in fact do want a specific IOR value (water and skin are good examples of needing this). In that case follow Schlick's approximation and divide the result by 0.08 to get the Specular number you need :)
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks mant1kore and somedoggy

    Needed this. Will try to implement what you have said. I am kinda new to pbr. Late to the party :) Thanks for the explanation. I did notice AO gives some level of artistic control.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10

    Definitely getting there. Still needs further subtle refinements. Getting to know the ue4 material editor is fun. Loving the realtime feedback so far :)
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Much better. I feel like those "line" details are too strong, and the inwards going little holes are not enough strong, especially compared to the line things. On your reference, I can see some of those lines but they are bigger scale and much less dense. And the holes are also bigger and more apparent as a detail of the surface rather than the lines. You can also see some brighter color between the bricks, and in some of those little holes. Its probably dust or some sort of that.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks Obscura for the crit.
    U are right about the holes taking precedence over the scratches/lines. Bricks have holes due to their molecular structure (concrete). Will refine it further.

    Also, I wanted to ask. If u have a texture with black and white areas and you want to adjust the black areas to be close to white while leaving the white areas untouched. How can this be achieved in the ue4 material editor? Is it the add or multiply node? I have experimented with these but its not quite the result I want.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Latest update:

    Looks better. Really impressed with Ue4 capabilities.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10

    EDIT: Nevermind. Fixed.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Would like to know if using the normal from heightmap function is okay to use. I am not sure ppl use it that much here. Turns out you can't smooth out low res jagged edges of normal maps using a grayscale texture.
    http://www.chrisalbeluhn.com/UT3_Vertex_Blend_Variation_Tutorial.html
    Using this for mask is just awesome


  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    If its okay or not depends on what it is going into, at the end. So is it like just some still renders or a short video, or a game, or what. Because if its a video or still, or even a small game, it should be completely fine... You balance shader complexity, textures and stuff based on your needs.
    Could be also just a portfolio piece, where you want to show nice artwork, in that case it should be fine as well. 

    Also, fine, or not, make a stresstest, and you'll see. You know your videocard and computer specs, print out your framerate, look at shader complexity, and the statistics, and you'll see what works and what doesn't.

    When you are thinking about optimizing a project, the first question is, you optimize it for what. 60 fps on this specs or 30 on that specs.

    Do tests on the target hardware if its anything more than a recorded video or still image, or a relatively or better balanced small game.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    It's going to be a video and some stills. It's for archviz but I feel understanding how to optimize is a good skill to have and learn how to apply if I need to undertake a bigger scale project in future and in cases where VR might be required. VR seems to be gaining ground nowadays for clients and stuff (probably the future) but like you pointed out it comes down to your CPU specs.
    I think I will do away with hardcore optimization and just try and get this project finished (taking quite a while since I am learning the engine properly). As for the texturing part, different from how I work but learning some new workflow and tricks has been informative.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Is there a way to use bump maps instead of normal maps? Bump offset seems to require a normal map plugged in I remember unreal engine 3 allowed this. U could just plug in a bump map in place of normals.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Yes, there's a height to normal map node, but it's much more expensive than a normal map.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Okay, thanks ZacD
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    EDIT: No worries.Nevermind
Sign In or Register to comment.