PDA

View Full Version : Querying fluid cell shaded color?


goebbels
07-27-2004, 12:58 PM
Hello all.

Is it possible to somehow analyze the shaded color (ie. as density appears in shaded view) of certain fluid cell?

As in, I have some density in fluid grid that appears in shaded view. Also I have bunch of particles overlapping the density in grid. I want to go through all the particles and query corresponding density value (and I mean with self-shadowing, not 'getFluidAttr -at density -xi $x -yi $y -zi $z' ) for every particle overlapping with the fluid volume and then use the value as rgbPP.

Thinking of "almost realtime" hardware particle volumetric rendering. The problem is not the algorithm itself but the way of accessing the data. Is it possible with mel or API ?

Pardon my crappy english, kind of difficult to explain what im looking for...

Duncan
07-28-2004, 05:56 PM
I'm not sure if you can directly get the output color of the fluidShape node.
However if you have a fluidTexture3d you can do setAttrs on
the refPointCamera and then getAttrs on the outColor to get its output color at any arbitrary
point( not just the voxel centers )(you can also access the outTransparency). The fluidTexture3d returns a color per point, while the fluidShape takes an input volume span and lightdata and returns a shaded color and transparency across the span.

The attributes for the fluidShape that you would need to set would be pointObject and farPointObject. However I'm not sure if this will work or not. Note that if pointObject and farPointObject are far apart it is a longer span through the fluid and the fluid should compute more density samples. The outTransparency would also be less for a longer span.
Unlike the fluidTexture the fluidShader will compute lighting and selfShadowing when you
do getAttr on the outColor( getting the outTransparency, however, does not process any
lighting).

At any rate for this to work inside an expression you must use set and getAttr calls, and not direct access of the input/output values.

Duncan

goebbels
07-28-2004, 07:05 PM
Thank you, mr. Duncan, for your answer. That made a perfect sense. Cheers! :-)

CGTalk Moderation
01-18-2006, 07:00 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.