Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Optimizing memory taken by some textures in standard shader

Discussion in 'Unity 5 Pre-order Beta' started by maxxa05, Dec 11, 2014.

  1. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    When using the standard shader, the current workflow waste memory with useless texture data. For example, it takes a RGB texture for the occlusion map, but only uses the green channel of the texture, which means we have 2 useless channels in memory for each occlusion map.

    Is there any way to make this more efficient, apart from making another shader with a different texture layout? If not, is there any plans to implement an alternative workflow to get less memory waste?
     
    p87, cakeslice, Zylex and 2 others like this.
  2. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I agree. The main one IMO is the metalness texture which uses the Red and the Alpha, but not the other two. This is a texture that you will always have. Perhaps the idea was/is that it's Red = metalness, Green = occlusion, Blue = something else, and Alpha = smoothness. So you just put the same texture in the different slots?
     
  3. maxxa05

    maxxa05

    Joined:
    Nov 17, 2012
    Posts:
    186
    Would Unity recognize that it's the same texture and load it only once in VRAM? It probably will, but I'm not sure. But yeah, that could work. The blue channel will still be wasted, but I guess that's as efficient as it gets.
     
  4. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I'm pretty sure it will store it just once in vram, but I think it will still sample ot twice in the shader.
     
  5. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    cakeslice likes this.