Announcement

Collapse
No announcement yet.

TGA vs PNG (for textures)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • TGA vs PNG (for textures)

    I've baked a 2k normal map in Blender and saved as .tga and .png. TGA is 8 MB, PNG is 2.5 MB - and there is no difference in image quality. That's why i'm curious about which format is better to use in Unreal Engine 4. Do you use .tga or .png for your textures? I didn't tried comparing their sizes with diffuse texture yet, so i don't know if there is also such a difference in this case...

  • #3
    I always use tga textures (it's a habit ^^)

    For the differences/other opinions:
    - http://www.polycount.com/forum/showthread.php?t=112149
    - http://www.digitaltutors.com/forum/s...A-v-TIFF-v-PNG

    Comment


    • #4
      PNG 24 bit is lossless compression. TGA is uncompressed. There is no difference in quality. If you want to save HDD/SSD space, then use PNG.
      All textures are ultimately converted to a format like DXT or BC7.
      The only thing that might be an issue is PNG w/ alpha. Make sure that the alpha data of PNG properly translates when imported and compressed in UE4.
      If there are issues, then use TGA for any textures that store alpha channels, and PNG for all others.

      Comment


      • #5
        Actually, there is a difference between PNG and TGA when it comes to reflections. TGA has better proportions when it comes to texture data for reflections. Replacing png with tga will give your materials better quality as far as reflections.

        Comment


        • #6
          Originally posted by ECGuy15 View Post
          Actually, there is a difference between PNG and TGA when it comes to reflections. TGA has better proportions when it comes to texture data for reflections. Replacing png with tga will give your materials better quality as far as reflections.
          Unless an actual unreal dev says this is true, I highly doubt it.

          _______________

          Personally, .PNG always.
          Never use alpha channels anyway.

          Well.. Unless I use alpha channel, but then I save the file as only using alpha and not use RGB for compression artifact reasons.

          Comment


          • #7
            Is my **** question as well/ As much as I researched. the TGA is better depending on Wat u want..
            Sad isnt it. PBR abd the TGA.PNG is relative. Again with ambiguity term.

            What is PBR
            Physically-based rendering (PBR) is an exciting, if loosely defined, trend in real time rendering lately. The term is bandied about a lot, often generating confusion as to what exactly it means. The short answer is: “many things”, and “it depends”, which is rather unsatisfying, so I have taken it upon myself to try to explain at some length what PBR represents and how it differs from older rendering methods. This document is intended for non-engineers (artists most likely), and will not present any mathematics or code.

            Much of what makes a physically-based shading system different from its predecessors is a more detailed reasoning about the behavior of light and surfaces. Shading capabilities have advanced enough that some of the old approximations can now be safely discarded, and with them some of the old means of producing art. This means both the engineer and the artist should understand the motivations for these changes.

            We’ll have to start with some of the basics so that they are well defined before we begin to highlight what is new, but if you’ll bear with me through the parts you may already know I think you’ll find it well worth the read. You may then want to also check out our own Joe Wilson’s article on creating PBR artwork.
            Diffusion & Reflection

            Diffusion and reflection – also known as “diffuse” and “specular” light respectively – are two terms describing the most basic separation of surface/light interactions. Most people will be familiar with these ideas on a practical level, but may not know how they are physically distinct.

            When light hits a surface boundary some of it will reflect – that is, bounce off – from the surface and leave heading in a direction on the opposing side of the surface normal. This behavior is very similar to a ball thrown against the ground or a wall – it will bounce off at the opposite angle. On a smooth surface this will result in a mirror-like appearance. The word “specular”, often used to describe the effect, is derived from the latin for “mirror” (it seems “specularity” sounds less awkward than “mirrorness”).

            Not all light reflects from a surface, however. Usually some will penetrate into the interior of the illuminated object. There it will either be absorbed by the material (usually converting to heat) or scattered internally. Some of this scattered light may make its way back out of the surface, then becoming visible once more to eyeballs and cameras. This is known by many names: “Diffuse Light”, “Diffusion”, “Subsurface Scattering” – all describe the same effect.

            iThis I coppied so you less learned will learn

            Thanks to ©2016 Marmoset LLC \

            By Jeff Russell Thank you With all respect/ You tausught me everything I know ao far

            The absorption and scattering of diffuse light are often quite different for different wavelengths of light, which is what gives objects their color (e.g. if an object absorbs most light but scatters blue, it will appear blue). The scattering is often so uniformly chaotic that it can be said to appear the same from all directions – quite different from the case of a mirror! A shader using this approximation really just needs one input: “albedo”, a color which describes the fractions of various colors of light that will scatter back out of a surface. “Diffuse color” is a phrase sometimes used synonymously.
            Translucency & Transparency

            In some cases diffusion is more complicated – in materials that have wider scattering distances for example, like skin or wax. In these cases a simple color will usually not do, and the shading system must take into account the shape and thickness of the object being lit. If they are thin enough, such objects often see light scattering out the back side and can then be called translucent. If the diffusion is even lower yet (in for example, glass) then almost no scattering is evident at all and entire images can pass through an object from one side to another intact. These behaviors are different enough from the typical “close to the surface” diffusion that unique shaders are usually needed to simulate them.
            Energy Conservation

            With these descriptions we now have enough information to draw an important conclusion, which is that reflection and diffusion are mutually exclusive. This is because, in order for light to be diffused, light must first penetrate the surface (that is, fail to reflect). This is known in shading parlance as an example of “energy conservation”, which just means that the light leaving a surface is never any brighter than that which fell upon it originally.

            This is easy to enforce in a shading system: one simply subtracts reflected light before allowing the diffuse shading to occur. This means highly reflective objects will show little to no diffuse light, simply because little to no light penetrates the surface, having been mostly reflected. The converse is also true: if an object has bright diffusion, it cannot be especially reflective.

            Energy conservation of this sort is an important aspect of physically-based shading. It allows the artist to work with reflectivity and albedo values for a material without accidentally violating the laws of physics (which tends to look bad). While enforcing these constraints in code isn’t strictly necessary to producing good looking art, it does serve a useful role as a kind of “nanny physicist” that will prevent artwork from bending the rules too far or becoming inconsistent under different lighting conditions.
            Metals

            Electrically conductive materials, most notably metals, are deserving of special mention at this point for a few reasons.

            Firstly, they tend to be much more reflective than insulators (non-conductors). Conductors will usually exhibit reflectivities as high as 60-90%, whereas insulators are generally much lower, in the 0-20% range. These high reflectivities prevent most light from reaching the interior and scattering, giving metals a very “shiny” look.

            Secondly, reflectivity on conductors will sometimes vary across the visible spectrum, which means that their reflections appear tinted. This coloring of reflection is rare even among conductors, but it does occur in some everyday materials (e.g. gold, copper, and brass). Insulators as a general rule do not exhibit this effect, and their reflections are uncolored.

            Finally, electrical conductors will usually absorb rather than scatter any light that penetrates the surface. This means that in theory conductors will not show any evidence of diffuse light. In practice however there are often oxides or other residues on the surface of a metal that will scatter some small amounts of light.

            It is this duality between metals and just about everything else that leads some rendering systems to adopt “metalness” as a direct input. In such systems artists specify the degree to which a material behaves as a metal, rather than specifying only the albedo & reflectivity explicitly. This is sometimes preferred as a simpler means of creating materials, but is not necessarily a characteristic of physically-based rendering.
            Fresnel

            Augustin-Jean Fresnel seems to be one of those old dead white guys we are unlikely to forget, mainly because his name is plastered on a range of phenomena that he was the first to accurately describe. It would be hard to have a discussion on the reflection of light without his name coming up.

            In computer graphics the word Fresnel refers to differing reflectivity that occurs at different angles. Specifically, light that lands on a surface at a grazing angle will be much more likely to reflect than that which hits a surface dead-on. This means that objects rendered with a proper Fresnel effect will appear to have brighter reflections near the edges. Most of us have been familiar with this for a while now, and its presence in computer graphics is not new. However, PBR shaders have made popular a few important corrections in the evaluation of Fresnel’s equations.

            The first is that for all materials, reflectivity becomes total for grazing angles – the “edges” viewed on any smooth object should act as perfect (uncolored) mirrors, no matter the material. Yes, really – any substance can act as a perfect mirror if it is smooth and viewed at the right angle! This can be counterintuitive, but the physics are clear.

            The second observation about Fresnel properties is that the curve or gradient between the angles does not vary much from material to material. Metals are the most divergent, but they too can be accounted for analytically.

            What this means for us is that, assuming realism is desired, artist control over Fresnel behavior should generally be reduced, rather than expanded. Or at the very least, we now know where to set our default values!

            This is good news of a sort, because it can simplify content generation. The shading system can now handle the Fresnel effect almost entirely on its own; it has only to consult some of the other pre-existing material properties, such as gloss and selectivity.
            Qukk stop here. Thank you

            Jeff Russell


            To Read More on this

            https://www.marmoset.co/posts/basic-...sed-rendering/
            Last edited by antoniobradiano; 01-08-2017, 01:50 AM.

            Comment


            • #8
              Is my **** question as well/ As much as I researched. the TGA is better depending on Wat u want..
              Sad isnt it. PBR abd the TGA.PNG is relative. Again with ambiguity term.
              nothing in what you quoted stated that TGA is better.
              also, the whole PBR quote has not much to do with the TGA VS PNG conversation.

              so... I am a bit confused.

              Comment


              • #9
                Since when does the format determine the actual output?
                It does not matter if you use png or tga, both formats are losless. The only difference may be in size.
                There's no such thing as "tga has better reflections". If you really think something like this, you have no clue how textures work.

                Comment


                • #10
                  Originally posted by Raildex_ View Post
                  Since when does the format determine the actual output?
                  It does not matter if you use png or tga, both formats are losless. The only difference may be in size.
                  There's no such thing as "tga has better reflections". If you really think something like this, you have no clue how textures work.
                  Yup, reflections on both are identical.

                  Comment


                  • #11
                    Originally posted by Luos View Post
                    Yup, reflections on both are identical.
                    hahaha +100
                    Hevedy - Image Tools: https://hevedy.itch.io/imagetools

                    Comment


                    • #12
                      The only real difference I've noticed is:

                      Photoshops alpha support in PNGs sucks, it will delete information in areas where alpha is 100% transparent, which isn't what you want for texture packing, and it doesn't treat alpha channels for PNGs like it does with TGAs.
                      16 bit PNG support varies and isn't universal.

                      So personally I use PNGs for everything but 16 bit textures or when I'm using a texture with an alpha channel.

                      Comment


                      • #13
                        Something maybe wrong with my Photoshop, but it will not allow me to export PNGs with any alpha, so if I want alpha channels, I use TGAs. However, even though TGAs are large files, they appear much smaller in engine in comparison to my previous textures that were JPEGs.

                        Comment


                        • #14
                          i use .PNG by default because its easy, by alpha support from photoshop is non-existent for .PNG. so for alpha'd textures i use .TGA.

                          Visit my portfolio: portfolio.jhgrace.com

                          Comment


                          • #15
                            This is why I opt for TGA instead of PNG, real pain to texture pack png's, hoping the alpha was packed properly.

                            Comment

                            Working...
                            X