Jump to content

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

Link to comment
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 :-)

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...