Search Unity

Help creating Ooze background

Discussion in 'Editor & General Support' started by DavidC02, Feb 3, 2012.

  1. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152
    Hello guys,

    I need to create an ooze/gel/slime looking texture for our game. It needs to move, so just a picture won't exactly do. It's going to work as a sort of background. What would you suggest? I'm trying a simple daylight water with different colors and setting the wave speeds to "slow numbers" but I'm wondering if there might be a way to make it look better.

    I found this picture that sort of showcases what we want


    Thanks.

    Update
     
  2. UnknownProfile

    UnknownProfile

    Joined:
    Jan 17, 2009
    Posts:
    2,311
    Why not use an image sequence?
    Code (csharp):
    1. var images : Texture2D[];
    2. var frameDelay = 0.2;
    3. var mat : Material;
    4. private var index = 0;
    5.  
    6. function Start ()
    7. {
    8.      while (true)
    9.      {
    10.           mat.mainTexture = images [index];
    11.           ++index;
    12.           index = Mathf.Repeat (index, images.length);
    13.           yield WaitForSeconds (frameDelay);
    14.      }
    15. }
    Script courtesy of Daniel
     
  3. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152
    Hey thank you very much. This would work great.

    How CPU intensive would it be though?
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    None, but it would be very RAM-intensive.

    --Eric
     
  5. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152
    Should I use something else then? It's going to be an iPhone game.
     
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yes, I would say so. You could do what you said originally, but use multiple layers for a parallax effect, though that would have issues with overdraw. I might be inclined to use a tessellated mesh and animate the vertices in a waving pattern.

    --Eric
     
  7. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152
    Gaining RAM but sacrificing CPU right?

    I'd need to do some research for that, mind pointing me in the right direction please? Just getting started with Unity heh.
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not actually CPU, since you can do that in a shader. Or you could use the Mesh class.

    --Eric
     
  9. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152
    Haven't learned to write shaders yet. I'll do research for the Mesh class. That plus what you mentioned above might work. I'll see how performance goes with image sequences first.

    Thank you very much.
     
  10. DavidC02

    DavidC02

    Joined:
    Jul 19, 2011
    Posts:
    152