View Full Version : Fluid image map: Tricks to maintain resolution
MikeRhone 07-19-2006, 09:04 PM Does anyone here have any tricks to apply a texture as a density in fluids, but to keep the image high res? I seem to remember a trick waaaay back when fluids first came out to do that without cranking up the container resolution too high. Can anyone point me in the right direction?
Mike
P.S. Forgive the cross post.
|
|
Aikiman
07-19-2006, 10:05 PM
Hi Mike, I dont have the solution but normally you would map it to a hi res 2D container as opposed to a 3D one.
MikeRhone
07-19-2006, 10:19 PM
Ya, that is what Im doing at the moment. It was a cool little trick of some kind, and the image on the fluid was very crisp and clean, and solved fast as hell...
Duncan
07-20-2006, 03:56 AM
If you use a 2d fluid texture you can set coordinateMethod = grid and coordinate speed to 1 then connect the outU and outV to the uvCoords of a second 2D texture you wish to push around. The texture will streak out, but will not blur.
Duncan
chiax2
07-22-2006, 08:57 AM
How do u map an image to the fluid..?
chia
Duncan
07-22-2006, 07:40 PM
How do u map an image to the fluid..?
This is not exactly mapping an image to the fluid.. it is using the fluid texture to set the uv values of a texture( which is applied to a shader ). The 2D fluid texture has a special outU+V attribute that allows you the the uvs of the texture. It it is a bit like using a 2D texture placement node... the shading engine provides an initial uv value(based on the surface at the current pixel) which the placement node then transforms and outputs a new uv which is connected to the texture uvCoord. The transformation being done by the fluid in this case is more complex than that done by the placement node, but the concept is the same.
Note that the above is using a 2D fluid TEXTURE. With non-texture fluids the coordinate grid can affect its built in noise texture, but can't be applied to shading network style texture. When mapping a non-texture fluid you must 3d textures(and these will ignore the coordinate grid). Event the 2d fluid node renders as a thin volume, and does not produce uvs for 2d texture mapping.
Just to clarify what it does when coordinateMethod = grid... It creates a dynamic grid of coordinate values and initialized them to 0-1 ramps in xy ( and z for a 3d fluid). The solver then pushes these coordinate values around in the same manner it pushes density. The values in the current coordinate grid are used to lookup the built in noise texture, so it will deform( this grid is dynamic so must be recached if the coordinate speed is changed ). In the case of the 2dFluidTexture we have an additional attribute to output the grid value at the current uv value.
At any rate the above is for having a texture pushed around without blurring... it will look like a bunch of swirled oil paint after a while. If one instead wants the paint to mix together ( like milk in coffee) then one can use the import option on the paint fluids tool to load an image into dynamic color(or density) grids.
One could use the no blur technique with volume fluids, but it require both a fluid and a fluid texture. The 2d fluid texture would need to be created as a planar projection and would have the coordinateMethod set to grid. The outUV would be plugged into the uvCoord of the desired file texture and then the file texture would be mapped to an attribute on the fluid like color. (note that for color mapping you need to map to a ramp color indice on the fluid, eg. fluidShape1.color[0].color_Color)
Duncan
Aikiman
07-23-2006, 09:07 PM
correct me if Im wrong, but I think Mike is talking about something else Duncan. His first post is a little bit ambiguous but Mike is applying a bitmapped image to the density values of a 2D Fluid rather than using the 2D fluid as a texture.
How do u map an image to the fluid..?
In simple terms you use the 'Paint fluids tool' > 'Attribute Maps' > 'Import' but make sure the paintable Atrributes is set to Density. You'll need to play around with Density scale and bouyency to get the right effect.
Edit: Having just read your entire post Duncan, you have mentioned the above process along with a whole source of very interesting material, thanks for that :)
MikeRhone
07-24-2006, 05:16 PM
Ya... My original post could have been clearer. I just seem to recall a trick to increase the visible resolution of the fluid, without having to increase the actual X and Y resolution of the fluid. It is possible I dreamt the whole thing up, but I was sure someone had a trick that helped increase the solve speed of a crisp image mapped to a 2d fluid.
Now after saying all this, what you have mentioned is extremly interesting. Im going to try and wrap my head around it and Ill let you know how it looks.
Duncan
07-24-2006, 11:26 PM
I was assuming that you wanted a highresolution 2d texture that moves with the fluid( the techique I described handles this ), as opposed to a static texture. For a static texture you can simply map it as a projection map on the fluid.. In the attribute editor select the color ramp indice (color is a ramp attribute on the fluid, so you must map an index) and right mouse over the color attribute name to see the mapping popup. If the fluid is a thick volume you may need to also increase the volumeSubsamples on the fluid to better sample the texture.Another option might be to project a textured light onto the fluid( this may work better in some cases and may not require the subsamples, but I can't remember).
Duncan
CGTalk Moderation
07-24-2006, 11:26 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.