Jump to content
markinglevfx

Point instance procedural with per-instance variations

Recommended Posts

I'm attempting to make a cloudscape time lapse and need to find a way to efficiently create the cloud volumes.

 

My solution so far has been to build the clouds themselves from spherical 'puffs' and to instance those puffs onto points at render time. My issue with this method at the moment is I can't find any way to have control over per-instance variations (beyond transforms, mostly looking for varying density). 

 

I have attached a file that shows a basic setup. Cache the frame to your local drive and make sure the instancefile attribute path is set to the cached file location correctly.

 

One solution to my problem could be to cache multiple cloud puffs at different density values, and use different instancefile paths. But this will get heavy quickly as I need hundreds of frames to make up the time lapse animation. I'm hoping to find a method similar to how you would do regular copy stamping, using pt attributes to drive variations in the instanced geo. But obviously copy stamping is too heavy for my purposes.

 

Any ideas/thoughts would be greatly appreciated! :)

clouds_v001.hipnc

Share this post


Link to post
Share on other sites

If you want to play with the density of cloud, I think this can be done in the volume shader, instead of tweaking the volume itself.

To play with the density scale of your volume at render time using point instancing, you need to :

- create an attribute on your points, let’s say « density_scale », put an attribute randomize node to randomly put a value within the ranges that you want (you can use lognormal law, uniform etc. And even a very cool discrete uniform, where you select the number of values you want, the values themselves, and the probability of occurence for each values).

- put a material node that references your shader and (i) create a material override and select the density scale parameter, (ii) tick the override use local variable so that in the value field of your override, you can put @density_scale, that was previously created.

This way, at render time, each of your point will render the « renderfile » cloud stored on disk, and override the density scale of your shader based on the value that is stored on the points.

I hope I understood well your problem and that this will helps :-)

Share this post


Link to post
Share on other sites

Thanks! But I'm trying this method and the geometry doesn't get instanced when I use a material SOP. Even though the same shader is selected, the geo is only instanced when it's selected on the geo node at obj level.

It seems like this should work though, am I missing anything obvious??

clouds_v002.hipnc

Share this post


Link to post
Share on other sites
4 hours ago, markingleukc said:

Thanks! But I'm trying this method and the geometry doesn't get instanced when I use a material SOP. Even though the same shader is selected, the geo is only instanced when it's selected on the geo node at obj level.

It seems like this should work though, am I missing anything obvious??

I modified your file and I noticed some mistakes : the attribute of the shader to override was not density but clouddensity, and the point instance shader was probably not used properly, so I just created an Instance Node, that take care of that for you, and you just apply your smoke shader.

I let you check if that works for you.

clouds_v002_vStepbystep.hipnc

  • Thanks 1

Share this post


Link to post
Share on other sites

I wonder why the cloud preset uses 'clouddensity' instead of just 'density'... My bad

Thanks for the help StepbyStep, your file works nicely! Using the instance obj is a lot easier to understand than having to deal with material stylesheets :D

Share this post


Link to post
Share on other sites

Yeah, the naming of shaders parameters can be sometimes tricky ! But when a proper shader is set in the shop material path, the list of all parameters that you can override appears, and that should help you finding the right one, next time :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×