Announcement

Collapse
No announcement yet.

Max number of texture instructions?

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

    Max number of texture instructions?

    Pretty vague question but is there a rough amount for something like a landscape? A Dev posted in another forum that they tried to stay under 100 for mobile but not sure the exact details. Right now I have a landscape with 10 texture samples and 226 instructions but I want to get an idea of how many instructions I can have before I start to run into problems. Any advice how how to bench mark something that specific or good techniques to use would be very appreciated.
    Current Projects -Cat Interstellar
    Lead Developer - Ionized Games

    #2
    It all depends on the system your client is using (if you're asking what I think you're asking). The more times the device has to call upon a texture the slower the game will run. So, for instance, if you're making the above mentioned mobile game - you might limit the actual number of textures to 100 by grouping objects together like you would a sprite sheet maybe (setting up the UV maps so that one object is completely in the lower right hand corner while the other is in the upper left). That way several objects could use one texture map and the device need only load that one map as opposed to two or more?

    Comment


      #3
      Hi Sandford,

      226 seems a bit high. From what I've been told there is not limit on the number of instructions you can have, but you will be limited by your computer's ability.

      Also I was told that if you're targeting PC follow the instructions for the Base Pass shader and if you're targeting mobile you'll want to keep an eye on the Vertex instructions.
      Tim Hobson | Learning Resources | Epic Games
      UE4 Documentation
      Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
      _____________________________________________
      Follow me on Twitter @TimHobsonUE4 | My Personal Website
      Photons Be Free: Mini-Tutorials and other Curiosities

      Comment


        #4
        Thanks for the quick responses. I should probably be more specific about what I'm trying to do. I'm trying to make write a paper on creating landscape materials for a Tech writing class. The problem is that I don't really know to make landscape materials. I've been messing around with the engine for a couple months but still have no idea what I'm doing.
        I know that each landscape component can only have 10 textures samples. 2 or 3(still not sure exactly) are used by the engine for lighting.
        This only leaves you with 6-7 textures person landscape component.
        I wanted as many different types of ground textures as possible so I did something odd that may or may not be more trouble than it's worth.
        I used four different ground textures and "hid" the red channel of the normal map in the alpha channel of the diffuse.
        I then added a fifth texture that holds the green channel of each of the texture's normal map and used the function DeriveNormalZ to rebuild the normal maps.
        This give me 4 ground textures with normal maps and 1 additional texture for noise(not sure what else)
        I used a bunch more instructions by taking each texture, rotating it, and randomly lerping it back together to prevent the textures from tiling.
        Here are screen shots of what I have. I feel like I'm kind of shooting in the dark and stitching together a Frankenstein material so and input would be tremendously helpful.
        My biggest concern is the number of instructions.

        Click image for larger version

Name:	instructions 1.jpg
Views:	1
Size:	413.8 KB
ID:	1060319


        Click image for larger version

Name:	instructions 2.jpg
Views:	1
Size:	461.0 KB
ID:	1060320


        Click image for larger version

Name:	instructions 3.jpg
Views:	1
Size:	366.8 KB
ID:	1060321


        Click image for larger version

Name:	instructions 4.jpg
Views:	1
Size:	367.7 KB
ID:	1060322


        Click image for larger version

Name:	instructions 5.jpg
Views:	1
Size:	470.4 KB
ID:	1060323


        Click image for larger version

Name:	instructions 6.jpg
Views:	1
Size:	441.5 KB
ID:	1060324
        Current Projects -Cat Interstellar
        Lead Developer - Ionized Games

        Comment


          #5
          For a PC based game 224 instructions is really not bad at all for a large landscape material that blends multiple surface types. As an example, the landscape material used in the Vehicle Demo project has 211, the Landscape Demo project material uses 288.

          I have built a water material that at one point was over 1200 instructions, it worked just fine but affected performance quite a bit. Currently it is using up 625 instructions (needs some more optimizing), but my FPS is in the 80's on a GTX 660ti. You are doing the right thing by using the extra channels of a texture for storage though, it will definitely help.
          Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

          Comment


            #6
            Here's an updated picture of my material with the normal maps working.

            Click image for larger version

Name:	HighresScreenshot.jpg
Views:	2
Size:	674.0 KB
ID:	1060348
            Attached Files
            Current Projects -Cat Interstellar
            Lead Developer - Ionized Games

            Comment


              #7
              well now I'm using 12 texture samples with no problem.

              I found this in the documentation
              "This reduces overall Material complexity, allowing the Material applied to the Landscape to contain any number of texture samples as long as the number of samples being used on any individual component never exceeds the maximum set forth by the shader model specifications (16 for SM 3.0)."

              source: https://docs.unrealengine.com/latest...als/index.html
              Last edited by sanford87; 11-06-2014, 06:37 PM.
              Current Projects -Cat Interstellar
              Lead Developer - Ionized Games

              Comment


                #8
                Originally posted by sanford87 View Post
                well now I'm using 12 texture samples with no problem.
                And in 4.6 you will be able to have up to 128!!!

                Can't wait! Because of my material setup requirements, I am only able use 6 actual textures with the rest being used by the engine but not for too much longer!
                Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                Comment


                  #9
                  woah what? was that in the twitch?
                  Current Projects -Cat Interstellar
                  Lead Developer - Ionized Games

                  Comment


                    #10
                    Originally posted by sanford87 View Post
                    woah what? was that in the twitch?
                    I just found out last week after asking a question about the SM5 limit, but have a look here:
                    https://forums.unrealengine.com/show...-Preview-10-31

                    Cant wait!

                    Also check out this thread for more info, Daniel from Epic explained it a bit more in depth.
                    https://forums.unrealengine.com/show...tual-Textures)
                    Last edited by DotCam; 11-06-2014, 07:29 PM.
                    Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                    Comment


                      #11
                      sandford 87 ,that last pic you posted is really nice scene.

                      keep posting any help/hints you can think of, landscapes for me are a big headache at the moment, stupid black spots keep popping up. and after I get rid of them, they come back if I edit anything.

                      but that's a really sharp pic, like it a lot.

                      Comment


                        #12
                        Thanks, a lot. Yeah, I feel the same way. I been trying all kinds of stuff and still haven't gotten the look I wanted or something broke. I've also been working on foliage. I'll post what I have with that when I get a chance.
                        One thing that would be a break through is a water layer but so far no luck. You can layer diffuse and normals but I haven't had any luck with the others.
                        Last edited by sanford87; 11-07-2014, 12:39 AM.
                        Current Projects -Cat Interstellar
                        Lead Developer - Ionized Games

                        Comment

                        Working...
                        X