Home Technical Talk

Help me get more optimized with this scene

jordank95
polycounter lvl 8
Offline / Send Message
jordank95 polycounter lvl 8
Currently working on a medieval town with houses ranging from small to larger houses. Im ending up having to use anywhere from 5-10+ materials per house, all tiling textures. Each material consists of full PBR tiling 2K materials for the most part, with a couple set to 512 or so. But this is what its all set to now to maintain correct texel density for my scene. Is 10 materials on an asset too many?

I can't really put each house on its own material because the pieces are too large, even with stacking UV shells etc. Also, Im using all of these tiling textures for everything else in the scene, including the other houses so its saving me time, but each asset ends up having anywhere from 1-10 materials on it. 

Is this a good approach, or is there a more optimized way I can do this? Sculpting a little set, and maybe building the houses from the set? Would that be better? Each house would have its own material then, rather than each houses having 10 materials. Any other ideas?

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    The important thing is the total number of materials on screen in any given frame (Actually it's state changes in the render pipeline that matter but we'll stick with materials for the purposes of explaining things to artists)
    The number of materials on a given building really doesn't matter

    If you have 500 buildings and they share 10 materials you have something very efficient

    If you have 500 buildings and 5000 materials you have something that's not very efficient

    It's basically impossible to tell you how many materials you're allowed - because there are a lot of ways to make things go super fast if you set up for it properly. 

     if you want to see how much damage you're doing to performance you need to compare frame times  before and after.
  • jStins
    Offline / Send Message
    jStins interpolator
    Sharing materials across multiple buildings is generally a good approach. You can also model elements in a modular way so that you're reusing meshes in addition to materials. While each building may have 10 materials, objects sharing a material will be batched into a single draw call. It can get more complicated than that, but you really need to profile the scene in engine to optimize it. It's hard to say if 10 materials for a building is too many without seeing the buildings. 
  • jordank95
    Offline / Send Message
    jordank95 polycounter lvl 8
    ok thanks for the replies. I think in general the scene is using maybe 20-40 materials total on screen at any given time (with props). Ill have to do some profiling, something I havent done before. Ill look up some docs on it. Thanks guys
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    20-40  materials is (to use a technical term) fuck all - You have nothing to worry about. 

    Assuming you're in Ue4 look at the stat console commands to see draw calls/frame times etc. 

    Don't get too hung up on it though, if you've done a village with 20-40 materials you're probably doing it right


  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master
    10 is nothing for a building, because of its scale. 10 drawcalls for a measly prop is probably a concern. As long as you're being resourceful in the sense that those materials are able to be referenced and used elsewhere, you're doing it right.

    The method you're using sure beats anything else afaik, especially if things were uniquely baked/textured, skyrocketing your drawcalls/material amts to the hundreds, with the added cost of those textures not being able to be referenced/used anywhere else, because they're unique to that prop.
Sign In or Register to comment.