Search Unity

Animated texture without a sprite sheet or code.

Discussion in 'General Discussion' started by robahouston, Feb 8, 2016.

  1. robahouston

    robahouston

    Joined:
    Jul 3, 2012
    Posts:
    16
    While I worked at a game company using DirectX 11 I was able to animate a fire texture by simply stretching the image past the UV bounds. This was some time ago and their engine was proprietary and my recent attempt to reproduce the effect has been fruitless. I know this can be done through code or a sprite sheet, however this is supposed to be a simple effect in the background with the image basically scrolling on the polygon. Also changing the vertex alphas allowed the edges of the polygon to fade.

    If anyone has anything on how this was accomplished or if Unity can do this let me know. I am using Max 2016 and Unity.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,571
    Well, you can write a (surface) shader and use builtin _Time vairable. You'll still need to write a shader, but that won't be a C# code.
     
  3. robahouston

    robahouston

    Joined:
    Jul 3, 2012
    Posts:
    16
    So the scrolling isn't something that is built into the directx shader in max or the built in shaders in unity? Also, I don't understand what you mean by write a shader. Can you explain or direct me to writing a surface shader?
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,571
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    You can just move the UV coordinates on the mesh.

    As another alternative you can offset the texture.
     
    zombiegorilla likes this.
  6. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,052
    Yea, if you aren't familiar with shaders and don't want to code, do this, and you can animate the values with the animator.
     
    theANMATOR2b and neginfinity like this.