CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 06-06-2013, 02:22 PM   #1
jonadb
3D Artist
 
jonadb's Avatar
Jonathan de Blok
Netherlands
 
Join Date: Mar 2003
Posts: 1,315
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, 158 views)
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl

Last edited by jonadb : 06-06-2013 at 02:30 PM.
 
Old 06-06-2013, 03:19 PM   #2
darthviper107
Expert
 
darthviper107's Avatar
portfolio
Zachary Brackin
3D Artist
Precocity LLC
Dallas, USA
 
Join Date: Feb 2004
Posts: 4,019
That's very cool, thanks for sharing
__________________
The Z-Axis
 
Old 06-06-2013, 04:47 PM   #3
boumay
Expert
portfolio
Steve Iskenderian
Freelance
Makkah, Saudi Arabia
 
Join Date: Jun 2010
Posts: 1,223
Thank you very much,
There's just a problem for max 2012 users, the mat file...
is it possible that you provide a compatible mat file for max 2012...
Thanks again

Last edited by boumay : 06-06-2013 at 06:50 PM.
 
Old 06-06-2013, 06:01 PM   #4
Rudiam
Expert
portfolio
maziar rud
Freelancer
Western Sahara
 
Join Date: Apr 2013
Posts: 329
Amazing work, straight to my essential scripts folder, it's times like this that makes me happy that I'm a Max user, thank you so much for sharing this with us.

All I need now is a couple of wwii fighter planes blasting through my clouds...
 
Old 06-07-2013, 10:38 AM   #5
TheRazorsEdge
detail freak
 
TheRazorsEdge's Avatar
portfolio
Felix Lahme
Essen, Germany
 
Join Date: Apr 2007
Posts: 2,081
Looks very interesting! Thank you very much for sharing.

Cheers!
__________________
"Knowing is not enough, we must apply. Willing is not enough, we must do."-Bruce Lee


 
Old 06-08-2013, 12:01 PM   #6
boumay
Expert
portfolio
Steve Iskenderian
Freelance
Makkah, Saudi Arabia
 
Join Date: Jun 2010
Posts: 1,223
Can someone help max 2012 users by providing a compatible mat file?
Thanks
 
Old 06-09-2013, 08:38 AM   #7
jonadb
3D Artist
 
jonadb's Avatar
Jonathan de Blok
Netherlands
 
Join Date: Mar 2003
Posts: 1,315
I've attached a max2011 scene that holds both materials, you can make a lib from that!
Attached Files
File Type: zip voluminance_mat_2011.zip (18.2 KB, 43 views)
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl
 
Old 06-09-2013, 08:41 AM   #8
boumay
Expert
portfolio
Steve Iskenderian
Freelance
Makkah, Saudi Arabia
 
Join Date: Jun 2010
Posts: 1,223
Thank you for this !
 
Old 06-11-2013, 03:38 PM   #9
em3
day dreamer
 
em3's Avatar
portfolio
Dave Tyner
3D Artist
Polyform Media
Denver, United%2BStates
 
Join Date: Jan 2004
Posts: 984
Send a message via Yahoo to em3
I created a teapot, used that as my mesh object. I loaded your mat lib (tyvm) and set the materials in the tool. When I render, I see the fake SSS happen but the perimeter of my sprites are not transparent and look "jaggedee". Also, should I be using the max standard renderer or MR?
__________________
www.davetyner.com
 
Old 06-11-2013, 04:45 PM   #10
jonadb
3D Artist
 
jonadb's Avatar
Jonathan de Blok
Netherlands
 
Join Date: Mar 2003
Posts: 1,315
I've put a simple renderable example file in my dropbox: https://dl.dropboxusercontent.com/u/1457762/example.zip

If you open the SME you can see both materials for MR and one for scanline. Add some noise to it for more realism.

MR is faster when turning FG off and using the opacity-card shader, scanline is quicker for simpler clouds. And a teapot is not really nice geometry for a cloud, the sprites are distributed randomly per face, so a cluster of small faces will get a higher sprite density compared to a the bigger faces. So model your basemesh so that is has a somewhat uniform polygon size.

edit: and a small 'bug' is that the material you set in the UI only gets applied when (re)generating the sprites, setting it after generation has no effect
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl

Last edited by jonadb : 06-11-2013 at 04:50 PM.
 
Old 06-19-2013, 07:34 AM   #11
MichaelWBell
Michael Wentworth-Bell
 
MichaelWBell's Avatar
portfolio
Michael Wentworth-Bell
Motion Graphics / 3D Artist
Reel Pictures
Melbourne, Australia
 
Join Date: Jun 2010
Posts: 556
This is a really handy script! Thanks for sharing Jonathan!
__________________
Michael Wentworth-Bell // Motion Graphics & 3D Artist // Melbourne, Australia

My VR-Diary videos - CG Talk thread
My Folio website
 
Old 06-19-2013, 07:34 AM   #12
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:46 AM.


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