Fluids incompatible with samplerInfo?

Hi I've been trying to use a shader network as the input to the opacity input bias of a fluid container with dynamic density and temperature, but it doesn't seem to work.

I want to get the effect of a spherical "shell" expanding through the smoke and making it thicker at the edge of this sphere. The shader network is roughly constructed like this:

a sampler info passes the point in world space being shaded to a distanceBetween, which calculates the distance between the shaded point and the center of the sphere (which is just the position of an object). a PlusMinusAverage node then subtracts this distance from an animated radius value and the result is passed to a animCurveUU which goes from 0.0 at input value 0.0 to 0.5 at input 0.3 to 0.0 again at input 6 so you get like a shockwave ring (but spherical).

The shader works fine on a regular object, but when I connect it to the opacity input bias of the fluid, I get nothing, or wierd results.

Is the opacity input bias incompatible with samplerInfo nodes? I have mapped 2d ramps to the opacity input bias before and that's worked. I'd really like to avoid using a 2d texture for this effect, although I guess one workaround is to recreate this "shock wave" effect with a circular 2d ramp.

The following pic shows the netork (mapped also to a regular lambert shader to show the effect on a mesh)

http://www.stannogen.org/Temp/Network.jpg

By default shading network connections are only evaluated at the frontmost boundary of the fluid container... thus your expression should evaluate as if it were applied to a shader on a cube. The built in texture on the fluid is adaptively sampled within the fluid container(doing this by iterating on shading network connections was too slow to be practical for textured and self shadowed volumes).

One can use the volumeSamplesOverride feature (on the fluidShape) to evalute the shading network connection within the fluids volume. Keep in mind, however, that you will need a very high volumeSamples setting to get a smooth looking spherical shell.

Another possibility to create a spherical volume might be to create a second fluid with the opacity input = center gradient and threshold the opacity graph. To scale the sphere, simply scale the fluid. If instead of scaling the fluid you increased the size xyz values on the fluidShape then the fluid noise texture would appear
stationary(like clouds with a blast pressure wave moving through them). If the 2 fluids are the same scale then the texture could be easily made to match between them, such that the blast wave appears to increase the density on the original fluid.

Duncan

Thanks for replying so quickly and informatively, Duncan. I will try both your suggestions.

"If the 2 fluids are the same scale then the texture could be easily made to match between them, such that the blast wave appears to increase the density on the original fluid. "

This is exactly the effect I'm after, so I'm leaning towards this solution. However I don't really understand the part where you suggest matching the textures between them. Do you mean I can texture the opacity input bias with another fluid? Because I don't want a "shell" over the whole container, only one that makes the existing density of the original fluid appear thicker when the shell passes it. Anyway, I'll stop asking and start trying. Thanks for the suggestions.

My suggestion is that if the texture on the second fluid exactly matches the texture on the first one, then the textured spherical shell on the second will appear to increase the density of the first. However I think it may be tough to get the exact effect you want this way. I'm imagine that you don't want to see the entire shell of the blast wave fluid, but rather a portion of it near the ground. A cylindrical gradient would be useful for this sort of thing.

Duncan