Home Unreal Engine

Blending/Switching between Texture Objects UE4

s6
polycounter lvl 10
Offline / Send Message
s6 polycounter lvl 10
Hey guys. I'm currently looking for a way to blend or switch between  texture objects in UE4 so I don't have to eat the cost of my UV set up, and what happens after the sampler, every time I need a different texture.  I'm assuming there probably won't be a way do operations on a t2d prior to the sampler, but I figured someone a lot smarter than me might know of a way. 

Everything I've tried so far has resulted in cast errors between non-numeric types or just incompatibility between t2d and float inputs. 

Any info is most appreciated! Thanks for reading

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    I'm not really getting what you're wanting to do. 
    The texture object can be a parameter I believe, but there really aren't operations you can do on it. Its the chunk of data in memory that IS the texture. So you can load it, replace it, and sample from the data.  The only way to get it on screen in any meaningful fashion is to sample from the texture in some way.
  • s6
    Options
    Offline / Send Message
    s6 polycounter lvl 10
    Right, I get that. 

    I was just hoping to avoid creating a new sampler for every new texture I need to implement. The leanest solution I can think of is one where I can re-use all my UV instructions, the sampler, and all the subsequent instructions after the sampler, without redundancy. But like you said, It appears you can't perform and operations on it. 

    Thanks for your time Vailias!
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    If you're doing some calculations on the UV's and you want to reuse the exact same UV data in the pixel shader part, then you can make your shader more efficient by doing that calculation and piping it into the customized uv's pin.  But for multiple textures you'll need multiple samplers. 
    https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/CustomizedUVs/index.html

  • s6
    Options
    Offline / Send Message
    s6 polycounter lvl 10
    Oh, Nice! That looks really promising. I'll be using customized UV's for sure :)

    Thanks for the Link Vailias!
Sign In or Register to comment.