Author : disting


Reply
Reply
 
Thread Tools Display Modes
Soul_of_Solace's Avatar
Old (#1)
Hello again!

I was looking at trying to create an interesting effect for this object:

My original intention was to create something with Cascade like a typical electric or energy effect (still might do so), but I got to thinking how I'd want to make something a little more challenging, and got the idea for seeing if there's a way in UDK to get a look where this tank is filled with a liquid with motion (bubbles, surface motion like boiling water). Best reference example I could think of would be an Erlenmeyer flask (though if it was boiling):


So I was wondering if anyone had any ideas or tutorials that would give me a hint as to how I'd set up such a material and implement it inside the glass container, if such a thing is possible.

Thanks!
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

maxivz's Avatar
Old (#2)
id add some polys to make the top of the liquid and thyen use textures + materials to make it look like you want, try some distortion within the udk material for the liquid part
Offline , spline, 220 Posts, Join Date Apr 2010, Location Argentina Send a message via MSN to maxivz  
   Reply With Quote

osman's Avatar
Old (#3)
Not sure if you´ve played HL2(shame on you if you haven't) but they had something that might help you out. It was in in the start, where you meet dr.kleiner.

Found a video:
http://www.youtube.com/watch?v=Wdvo6...ailpage#t=350s

You could probably open that asset up in source and see how they've built it.
www.gameartist.nl
Environment Artist - Guerrilla Games
Offline , polygon, 533 Posts, Join Date Aug 2005, Location Netherlands Send a message via MSN to osman  
   Reply With Quote

Ace-Angel's Avatar
Old (#4)
Problem is that in HL2 it was full, so you could animate it easily from the Distortion channel, on the other hand, I'm guessing the author wants it to be half full, and actually the top bending pending on view.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#5)
Quote:
Originally Posted by Ace-Angel View Post
Problem is that in HL2 it was full, so you could animate it easily from the Distortion channel, on the other hand, I'm guessing the author wants it to be half full, and actually the top bending pending on view.
Quite so, I was hoping to be able to have them partially full if possible, and vary the heights across the different capsules in the scene. Though I did imagine that would probably be a bit more complex. But I'm definitely wanting to see what I can accomplish.

I also do not have access to Source at the moment.
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#6)
Is the glass a separate mesh by any chance? And if yes, could you show the UV's?

Also, does it have thickness or is a single plane? Pending on how you set it up, there many solutions, so just fill in my questionnaire and I'll see what's possible in my lab.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#7)
The glass is a separate cylindrical mesh, and it is just a single plane with no thickness to it, and here are its UV's (for some reason I laid them out like this so the bottom half of the texture could be a different color, though that might have been unnecessary):


I'm certainly open to solutions of any kind and am more than willing to change what is there (making a new geo or changing the UV's) to make it work.

Thank you!
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#8)
Well, first thing comes to mind is this (note I'll be talking about a procedural, feel free to use textures as you see fit).

Also, I'm going for the most expensive solution, but hopefully you can come up with your cheaper solution since the basic idea applies.

Change material type to Translucent.

Take a TexCoord node and Mask out whichever direction your want the gradient to fade out (R or G) pending on your UV's. Multiply a Constant by it, Power it, and Clamp at it end.

With the Mul you will dictate the 'amount' of liquid you want, with the Power the hardness near the end top and the Clamp will make sure it all doesn't glow like a radioactive waste.

Mul all this by a color of your choice.

Now here is the tricky part, put up a Lerp and insert the Fresnel in the Alpha, you're going to have to do this for pretty much all the other parts, basically your inner 'fluid' vs. the outer 'thickness' of the tube.

On the other hand, if you don't want this (you want complete fluid) then for the color it won't need a fresnel.

In the distortion slot however, keep the Lerp/Fresnel build, put a constant of either 1 or 0 zero for the interior, but for the edges, Multiply a Fresnel node by a Reflection, set the Fresnel value for the latter to something really low, like 0.5, etc.

As for the top, part, I'm honestly temped to just say stick in a flat plane and mask it with the effect, but there would be other issues there.

You could try and mask only a little part at the top, and bump offset the effect, add fresnel, etc, stuff to fake that 'bend' of light towards the eye, but I'm not sure if the extra math and nodes for a tiny small strip will be worth it.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Santewi's Avatar
Old (#9)
You could also duplicate the glass model (cylinder), scale it down a bit, and place it inside the glass. Change the Z scaling if you want less/more fluid. The glass is going to look a bit thick though, of course you could set the fluid object's scale to something like 99% of the glass but you are probably going to get a lot of Z-fighting by doing so. Then use WorldPositionOffset or tessellation to get the movement on the top.

I think I've seen this at least a few times in games.
Offline , spline, 153 Posts, Join Date Mar 2012,  
   Reply With Quote

divi's Avatar
Old (#10)
yeah, making an actual model for the liquid is probably the easiest and best approach. you could mask the movement to only affect the upwards facing faces as well.
Offline , polycounter, 866 Posts, Join Date Jan 2009,  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#11)
Well, this is as far as I've been able to get until I cannot figure out what else to do. I'm totally stumped about the Lerp and Fresnel aspect and how to get this thing transparent so it's not black above the line.

I also created another mesh for the liquid inside the glass, but I'm already having problems with Z-fighting with the camera position.

Despite my constant turning to the Material Compendium (http://udn.epicgames.com/Three/MaterialsCompendium.html), I still am not totally understanding how these calculations are being interpreted.
Quote:
Now here is the tricky part, put up a Lerp and insert the Fresnel in the Alpha, you're going to have to do this for pretty much all the other parts, basically your inner 'fluid' vs. the outer 'thickness' of the tube
What goes in the A and B slots of the Lerp? and what goes into the "Normal" of the Fresnel?
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

fearian's Avatar
Old (#12)
As an off-the-top-of-my-head thought train... You will need a mesh for the glass, and a mesh for the liquid. You can have the liquid mesh distort and fuzz out the edges slightly, and stick a particle emitter for the bubles inside. Then one thirs mesh, a plane, lightly above the waters surface with an enimated and alpha'd out ripple effect.

Edit: Having a liquid mesh also means you can give it some animation for a psuedo physics effect, ala jigglebones in TF2 -

Last edited by fearian; 08-13-2012 at 01:43 AM..
Offline , dedicated polycounter, 1,610 Posts, Join Date Oct 2008, Location UK Send a message via Skype™ to fearian  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#13)
^^^An animation effect like that is very much desirable and kind of what I had been imagining. I do have a liquid mesh now, but I wouldn't know how to set it up to do that. I've set up bone structures in the past but wouldn't know how to begin with something that would ideally be a bit random.

I have at least made some progress getting the thing to be transparent now, but still need to figure out the distortion part.


EDIT: ok, I think I've got the basic distortion network down, I definitely am getting that subtle "fish-eye" effect now within the glass:


Question: I am wondering if there is some kind of trick I can utilize with the mask to make it oscillate up and down to give off that look like the liquid is moving on the sides at least

EDIT2: Got some bubbles (via flipbook texture and Cascade) in for effect.

Last edited by Soul_of_Solace; 08-13-2012 at 06:05 PM..
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

AbominableSoul's Avatar
Old (#14)
I would take a look at the water materials that UDK comes with.
they have very very good ways of setting up liquid movement.

you can then change the speeds at which the liquid moves.

if you are feeling like having a static movement is way too boring, you could always create a material instance and then have it do funky things as the player gets closer or farther away or hits a button.
like changing colour

but first thing first, if you want it to look like its moving, i highly recommend looking at how the UDK materials are set up for water.
Offline , null, 16 Posts, Join Date Aug 2012, Location Toronto, Ontario, Canada  
   Reply With Quote

AbominableSoul's Avatar
Old (#15)
p.s. a material instance will also mean variation, so that not all the tubes have the exact same animations at the same time.

i say this because i see a 2nd object in the back of that last picture you posted.
if you have lots of them lining the hallway (thats what it sort of looks like you have planned), it can become very repetitive and takes away from a more natural feeling environment if they have the same identical animations.
Offline , null, 16 Posts, Join Date Aug 2012, Location Toronto, Ontario, Canada  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#16)
You are quite correct about variation, which was the idea I was hoping to do with the tubes given that to fill them with the exact same amount of liquid and consistency/color would be too repetitive. And you are quite right. The Material Instances are an amazingly handy tool to diversify things (height, color, etc.)


Now I need to start working on the "lid" of the liquid, in addition to getting some slight normal/distortions around the glass so that the liquid has a more sludgy feel to it than a "cloudy" one. I definitely saw some Epic liquid/goo materials that looked very interesting, though quite complex, that I'll certainly do my best to reference as I continue constructing the network.

Last edited by Soul_of_Solace; 08-14-2012 at 03:32 PM..
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#17)
Use vertex colors for the distortion on the top, like this:


Then marry it to a Sine or Cosine for the slight ripple effect, but you will need quite a few points of vertices to make it look good.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

fearian's Avatar
Old (#18)
Ooh thanks for posting the material, I Think it might be what I'm looking for to make some emissive effects!

Last edited by fearian; 08-15-2012 at 04:57 PM..
Offline , dedicated polycounter, 1,610 Posts, Join Date Oct 2008, Location UK Send a message via Skype™ to fearian  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#19)
Ok, so I've spent time trying to wrap my head around how Vertex Displacement works. I've got some idea of the mechanics, but the implementation is still eluding me. I'm getting inconsistent results in terms of the movement not moving in the direction I'd want it to (it seems to move side to side instead of up and down), the power of the movement (in the Static Mesh preview, it is much more noticeable and visible than it is in the level itself).

That's basically what I've managed to set up that somewhat works. I still don't know how I'm going to match the liquid plane to match the texture since it doesn't look like they're really melding together well.

How do I know which vertex colors affect height? I was just painting random colors in Maya, do some colors move the verts in different directions than others?
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#20)
Only use one color, I suggest Red, then take the Red Channel from the Vertex Node and voila, unless Epic has changed the way Vertex colors are handled, this method should work.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#21)
Quote:
Originally Posted by Ace-Angel View Post
Only use one color, I suggest Red, then take the Red Channel from the Vertex Node and voila, unless Epic has changed the way Vertex colors are handled, this method should work.
I'm still very stumped. I've been changing channels and masks trying to just get the offset itself to work (before even trying to get the sine issue going) and I'm not able to even offset the baked vertex's in the Z axis.

The upper image is nothing happening when trying to just use the Red channel. The lower image is some deformation when using all channels, however, the deformation is only occuring in the XY plane, not the Z axis which is what I'm trying to get.

This is starting to get very frustrating. There isn't much tutorials or information given on how to set up a vertex displacement node network out there either, at least, nothing that applies to using baked vertices.
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#22)
lol, of course it is as simple as just plugging the whole vertex shader in (to check for the offset itself). I guess just plugging in an individual channel like Red does not seem to work:

Now to get it set up so that the sine is only shifting the vertices upwards instead of side-to-side is tricky
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#23)
Hmm, seems like abit has changed since my hayday, because I usually do this and it works: http://udn.epicgames.com/Three/WorldPositionOffset.html

OK, so it looks like you have the basics of your material down, Mul the Vertex node by a Constant of 2 to exaggerate so you can see it better for the testing, then Mul the entire thing by the effect the Time-Sine node and see if the material works.

If this works, then so far, so good, meaning the issues is with the World Position node. Try Masking different channels or using other Position nodes instead, although in all cases, World Position should be used and SHOULD be working.
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Soul_of_Solace's Avatar
Old (#24)
Thank you sir! Yeah, I was looking at the WorldPositionOffset udn page as well for information. Two things were messing me up though. Using just one channel from the VertexColor node did not work, and the preview in the Static Mesh viewer was way way off from how it actually looks in game (the mesh is pretty much exploded into tiny pieces in the preview, yet, in-editor it looks fine.

It's also amazing how quickly a solution can present itself with a little perseverance. Here is the material network I finally figured out for the ripple effect:

Of course, seeing is believing. I'm gonna upload a video to show it in motion, once vimeo lets me

EDIT: Finally uploaded. Still needs some work though, might think about redoing some of the baking and getting a better sense of a pattern that would go well with the movement. Also need to work on some improved shader quality for the liquid itself so it looks more like a liquid and less like cloudy water

http://player.vimeo.com/video/47790456

Last edited by Soul_of_Solace; 08-18-2012 at 05:04 PM..
Offline , spline, 125 Posts, Join Date Aug 2010, Location San Francisco Bay Area  
   Reply With Quote

Ace-Angel's Avatar
Old (#25)
Glad you got it working
There's a very good chance that I experienced MORE problems, then all the internet put together in the area of 3D. Talk about being original for once...
Offline , veteran polycounter, 4,502 Posts, Join Date Apr 2011, Location Canada  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch