Voluminance Cloud Script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  06 June 2013
Voluminance Cloud Script

I was going to make this a commercial one but screw that I'll up a proper release to scriptspot later.

A short video showing an older version but the process is the same: http://vimeo.com/59950346

Script attached, including a mat lib that gives you the the 'mr_card' shader for very fast rendering of sprites in MR.

Please share if you made something nice with it, enjoy!

The manual:
Pick Mesh / Pick Light

This is your starting point, you pick a mesh that will form the base shape for your cloud and a light source you want to use for illumination. Best is to use a mesh that is mostly uniform in polygon size and avoid long thin faces. Start with a low/medium res object to quickly get a feel for all the different parameters, for default clouds a hires base shape is not even necessary. The light source is only used for it’s position, intensity and color can be setup independently for more artistic freedom.

Note: the mesh will be collapsed to an EditablePoly to speedup calculations, a backup of your mesh will be created called “<originalname>_backup’ and will it will be hidden automatically.

Light & Luminance color

‘Light color’ will determine the color of the cloud where light hits it directly, this color is then darkened by the amount of volume the light ray travels through. The amount of darkening per traveled volume is set by the ‘Absorption’ factor explained later on.

‘Luminance color’ is for the secondary component of the lighting model. After calculating the light intensity at each vertex, using the absorption model, they will affecting all surrounding vertices within a given radius using the ‘Luminance color’ and distance to calculate the additional secondary light influence.

Mesh & Sprite material

Here you can pick two materials, one that will be assigned to the bae mesh and one for the sprites. Maxscript doesn’t support drag&drop so you’ll have to pick them manually. The basic idea for the basemesh is to have the calculated vertexcolors set as a self-illumination map. The sprites will be textured by their own vertex colors and a radial opacity map resulting in little ‘puff’ textures. For a quick start the basic setup for both materials is included as a material library.

Load & save preset

Create presets for all adjustable parameters. The presets are normal ini files and can be edited manually if needed, you can for example safely remove lines from these files and only have the remaining parameters loaded.

Volumetric Absorption

Absorption

Determines how much light is absorbed per distance traveled inside the volume of the base-mesh. Low values will make the cloud more absorbing , higher values will let light travel further.

For selected faces only

This will only do calculation for the selected faces. You can use this to quickly setup a small parts of the base-mesh and when content with the results do it for the whole mesh. Internally the intensities for each face center is calculated and these values are then averaged over the vertexes and stored as vertex colors. So each vertex that belongs to a selected face will be affected when this option is checked.

Luminance

Radius

Each vertex can be thought of as an omni lightsource emitting it’s vertex color to all the surrounding vertices within a spherical volume using the given radius.

Amount

A simple multiplier to weigh the amount of luminance used.

For selected verts only

Only calculate the luminance for selected vertices when checked. Use this to quickly setup luminance for a small area, when content with the results uncheck and calculate for the whole cloud.

(Re)calculate absorption

Doing luminance calculations is ‘destructive’, as in it overwrites the current vertexcolors. So while setting it up you can automatically recalculate the absorption step so you’ll start with the same original vertex colors each time.

Cover mesh in sprites

Count

The total number of sprites distributed of the surface

Size@surface

Absolute sprite size when placed on the surface. When using a random offset size can vary depending on distance to surface. If that offset is 0 all sprites will have the size given here.

%size@offset

Relative sprite size at max distance. When using a random offset this size will determine the sprite’s size at maximum distance.

%size variation

Relative size variation, independent of offset.

Offset max dist

Sprites will be places between the surface and a random offset along the face’s normal.

Offset bias

A bias of 0 will result in a uniform offset distribution between the surface and the offset, values >0 will pull the offset average closer the surface.

On selected faces only

Add sprites to selected faces only. Use in combination with the ‘Count * (% selected faces)’ parameter to quickly setup a small area that will be representative as if you would have covered the entire mesh.

Count * (% selected faces)

Checking this option will make sure you get the same sprite density when you’re applying sprites only to a small area of selected faces as if you would cover the whole mesh is sprites. So if you have on 10th of the faces selected you’ll only get a 10th of the given ‘count’.

Add sprites (don’t replace)

When checked existing sprites are left in place and addition sprites are added. Use this to patch small areas that need more sprites.
Attached Files
File Type: zip voluminance_1_3.zip (8.6 KB, 170 views)
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl

Last edited by jonadb : 06 June 2013 at 02:30 PM.
 
  share thread



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:09 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.