Phoenix FD Liquid Color from Grid

Forums: Phoenix FD Liquid Color from Grid
3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here viewforum.php?f=18

Phoenix FD Liquid Color from Grid

Postby neonZorglub » Mon Jan 15, 2024 2:30 am

neonZorglub Mon Jan 15, 2024 2:30 am
(Available from version 2023.1.2 - 14.8 and 2024.1 - 15.03)

A new set of Octane Vertex attribute Generators can be used to read the Phoenix liquid grid to add Color data and other simulator data to the liquid mesh.

This allows to render liquid effects like color diffusion when multiple liquid sources with different colors are used.

Those screenshots illustrates the effect:

liquid RGB grid color to vertex attribute.png

see sample PhoenixFD_RGB_Diffusion_mx17.max, with 3 liquid sources

liquidGrid_Color.png
liquidGrid_Color.png
see sample liquidGrid_Color.max , with 2 liquid sources

---- Phoenix setup ----

Note that to display the liquid mesh with Octane, you need to set one of those 2 options in the Phoenix liquid object:
-Preview panel: Show Mesh
or
-Export panel: Export as : Mesh

To use the liquid color:
Output panel: Output Grid Channel : enable 'RGB'

And for each of the liquid source objects:
enable 'RGB', and set a color
liquidSource_RGB_enabled.png


Run the Phoenix simulation with those settings, and the 'RGB' should be visible in the 'Cache File Content' information box:
Phoenix_liquid_RGB_enabled.png
Phoenix_liquid_RGB_enabled.png (6.99 KiB) Viewed 431 times


---- Octane Generator setup ----
-Add an Octane Geometry Modifier to the Phoenix liquid.
In the Vertex Attributes Generator pannel:
By default, there is 1 generator (Generator Count: 1), and the Selected generator should be 0.
For Generator, select 'Phx Grid Color'
For Attribute, select 'Color1'
For Attribute name, select 'GridRGB' (using the 'Common attribute names...' button)

Material editor:
Create a Octane Glossy material
For the Diffuse parameter, create a 'Color Vertex Attribute' texture (available in the 'Octane' / 'Geometric' group)
Edit this Color Vertex Attribute texture:
Set the Name to 'GridRGB' (using the 'Common attribute names...' button)

Assign the material to the Phoenix liquid object.

-------- Other grid data -----------

Other phoenix data can be generated in the Phoenix grid (see the Output panel), and can also be read by Octane to be used by materials.

There are vectors (3 floats) and single floating point values.
The 2 existing vector data are RGB (as described above), and the velocity.
Those are readable by setting the attribute name to 'GridRGB' and 'GridVelo3' respectively.

Note that the velocity values are signed values, and the range depends on the simulation parameters.
For example, it can varies from -300 to +300.
To display / use it as a color in Octane, some oparator texture should be used to adapt the values to a color range (0.0 to 1.0)
See liquidGrid_Velo3_as_Color.max, that uses a 'Unitary math operation' texture with the 'Absolute value' to make the negative values positive.
Note that in the case of velocity as a vector, the range seems already in the [-1 / + 1] range.
liquid_velocity_as_color.png

see liquidGrid_Velo3_as_Color_mx17.max

Velocity as a single value:

To read single float values from the Phoenix grid, set the generator as follow:
For Generator, select 'Phx Grid Float'
For Attribute, select 'Float1'

for the Velocity as a single value, set Attribute name, to 'GridVelo1'

The texture to use to render those single float data is the 'Grayscale vertex attribute' texture.

liquidGrid_Velo1AsGreyColor.png

see liquidGrid_Velo1_as_GreyColor.max

Other floats available:
GridVisco matches 'Grid Viscosity' output
GridSmoke matches the 'Special' channel
GridLiq always available

[not usable with liquid simulation - reserved for future use]
GridFuel Fuel channel
GridDivFilt Divergence filtering
GridPrt Particule [?]
GridInj Injection [?]
GridWavEnerg Wavelet decomposition of the energy field


Note that GridLiq is not very useful in this context, as all liquid vectices are on a grid cell that has a liquid value around 1.0..

---- Multiple generators ----
It's possible to use multiple vertex attribute generators for the same grid, to read multiple grid channels.

For example, you can combine the RGB color with the velocity.

liquid_ColorAndVelo1.png

sample: liquidGrid_ColorAndVelo1.max

Use the 'Add' button to add a second generator, and change the 'Selected generator' to edit each generator's parameters.

It's important to use different Attribute for each generator (eg Float1, Float2, .. or Color1, Color2)

Samples:
Phoenix_Liquid_Color_From_Grid.zip
(3.63 MiB) Downloaded 24 times
neonZorglub
OctaneRender Team
OctaneRender Team
 
Posts: 899
Joined: Sun Jul 31, 2016 10:08 pm

Re: Phoenix FD Liquid Color from Grid

Postby remKa » Mon Jan 15, 2024 1:49 pm

remKa Mon Jan 15, 2024 1:49 pm
Thank you very much !
i7 3930K / 1 EVGA Titan Black SuperClocked - 1 GTX Titan - 1 GTX 960 / 32 Gb DDR 3
http://www.remka.fr
https://twitter.com/remKa_
remKa
Licensed Customer
Licensed Customer
 
Posts: 181
Joined: Fri Jan 24, 2014 6:23 pm
Location: Paris

Return to Autodesk 3Ds Max


Who is online

Users browsing this forum: No registered users and 11 guests

Sat Apr 27, 2024 3:38 pm [ UTC ]