Home Unreal Engine

New texture sample or use alpha?

Which one is better? I'm working on a master material that's going to be instanced numerous times. I've used up all my channels of the current texture samples (there's 6 of them) except for the alpha channels of the normalmaps. I'm in need of one more mask for the emissive slot and so I'm wondering if it would be better to add a new smaller mask texture (the main textures are 1024x2048 ) or if I should use one of the alpha channels?
I suppose the first option will create another texture call but the later will increase the size of that existing texture. Which option would be better?

Replies

  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    If you're only going to be needing the one channel, I'd say use an alpha channel. As you've said, an extra texture is going to be an extra fetch, and you'll still take the same memory/disk size hit.

    On the other hand, if you expect to need another channel down the line, then the additional texture makes more sense.

    I think for now I'd go with the alpha channel. If you end up needing another channel, you can batch process your textures to move the alpha channel to a new texture and reimport, and then change the hookup in the master material.
  • o2_is_alright
    Options
    Offline / Send Message
    Thanks for your reply. I don't think I'll be needing another channel. But would there be any profit in removing the alphas from two other textures and add them with my mask in a new texture? Then the new texture would be replacing 3 alpha channels. Still better to use the alpha?
    And I'll throw in another question about the texture samplers. I'm using 5 texture files from the content browser and in my material there's 6 Texture samplers. I thought that every texture sample with different texture coordinates would increase the total number of texture samplers for the material but that doesn't seem to be the case because then I'd have more than 6?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    I couldn't say for sure what the difference would be like for an extra fetch if you've already got 5 going on, but you'd definitely be saving disk space by replacing 3 alphas with a single RGB (since a single alpha channel costs as much as a full DXT1 RGB texture).
  • o2_is_alright
    Options
    Offline / Send Message
    Sweet, thanks for your help:)
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    @o2_is_alright

    is the master material for UDK,

    if it is make some static switch parameters in it, so you can switch between using spec, in diffuse alpha, and spec as it;s own texture per instance.

    it's what i have done in my master materials is have a few switches that tell it where to get certain textures from, and a few more for enabling and disabling different features, such as detail normals, rimlight, bumpoffset etc.

    there pretty easy to use just a node with 2 inputs and 1 output, if set true it uses input A if False B, they can even be toggled in kismet or uscript to enable or disable things in a material during runtime.
  • Brendan
    Options
    Offline / Send Message
    Brendan polycounter lvl 8
    Wait, if you're just using emissive, then it's additive. You shouldn't need to use a mash for it; any black areas won't change anyway. White should be full opacity, black should have no opacity, and anything in between should add as a fraction based on it's luminosity.

    Unless I've read it wrong and you need to use another channel as the emissive itself.
  • o2_is_alright
    Options
    Offline / Send Message
    @Brendan I think you misunderstood. My material is not additive, I just wanted to be able to add optional glow and stuff to certain areas of my material:)

    @passerby Switches is definately something I'm gonna add to my material to optimize it but I'm not sure I'll be able to use it for the texture samples. I'm using all channels for different things (inspired by this thread ) so it's not really the traditional kind of diffuse/spec textures. Actually I think I'm gonna try and place it in the blue channel of the normal map. Got terrible compression artifacts last time I tried that but it should work so I'll give it another go.

    Also I talked to a programmer at work and he suggested I should make a simple test level with the different solutions and check the framerate with stat UNIT. I'll post here again when that's done.
Sign In or Register to comment.