Jump to content

sand grains upres scale variation - OR... HOW TO NEARLY BLOW THE FAN ON YOUR PC!!! :)


anthonymcgrath

Recommended Posts

okay so i've got a little issue here... I have FINALLY (After 30 hours of twiddling) got a really nice fairly stable sand grains anim going that interacts nicely with my char.

so i've got my node network which is a basic off the shelf grains upres...  i'm trying to wrap my head around whats happening in setseed_adjust_scale attribute wrangle node but i cant suss it out :(
anyway what i want to do is vary the scale of my upres particles making some bigger and some smaller.  so in my head i drop in a new attribute wrangle node (circled red in the pic) and i add the following:


 

float @pscale = 1;

@pscale = rand (0.002, 0.006);

 

and BLAM!  my pc fan after 30 seconds nearly ran out the window screaming!!!!!  Its done this twice now and just locks up hou and the pc!


so i'm properly stuck here - i cant figure out how to vary the scale of those upres particles - they are all the same size :(  Anyone got any ideas on how to adjust this?

ta
ant

grains01.JPG

grains2.JPG

Edited by anthonymcgrath
Link to comment
Share on other sites

Ant, I see what you mean, I think your OGL driver is getting blown away by the quantity and large scale of the sprites. Try adding something like this to the setseed_adjust_pscale wrangle:

@pscale *= fit(rand(@ptnum+102.377),0,1,0.5,1);

This will modify the existing @pscale values, multiplying them against random values ranging from 0.5-1

This won't work if you have a changing grain count though, as the @ptnum values will be varying per frame. We also can't just inherit @id and use that, as each set of duplicated points will inherit their parent's ID and will get the same random seed value.

--Dave

  • Like 2
Link to comment
Share on other sites

Hi Dave yeah it scared the crap out of me.. sounded like the turbo under the car at one point haha!

Right I'll give that a go.. yeah I did find that when I took the values down in my initial vex lines to something like 0.00000004 for example then it seemed to be less strain on the pc. The original number still resulted in enormous sprites lol!

 

What you explained there about the changing grain count makes good sense. I think my grain count stays the same because I generated it from a simple shape on the ground initially.

 

So once i have my initial base grains sim.. i yank that into a new geom node and I had to use a few blast nodes to clean up a few weird particles.  After that I then apply my upres. So I can try that vex script you mentioned :)

 

Thanks Dave I'll pop a little playblast up later :)

Ant

  • Like 1
Link to comment
Share on other sites

13 hours ago, Dave Stewart said:

Ant, I see what you mean, I think your OGL driver is getting blown away by the quantity and large scale of the sprites. Try adding something like this to the setseed_adjust_pscale wrangle:

@pscale *= fit(rand(@ptnum+102.377),0,1,0.5,1);

This will modify the existing @pscale values, multiplying them against random values ranging from 0.5-1

This won't work if you have a changing grain count though, as the @ptnum values will be varying per frame. We also can't just inherit @id and use that, as each set of duplicated points will inherit their parent's ID and will get the same random seed value.

--Dave

hi Dave whats the 102.377 number for btw?

i'm still trying to wrap my head round some simple vex stuff :/

anyway i applied the code line there and hid behind the sofa fingers in ears... but it worked a treat thankyou :D

grains01.JPG

Edited by anthonymcgrath
saying thanks and upload pic
Link to comment
Share on other sites

@Dave Stewart - i just want to say a BIG thankyou for your help on getting these sand grains working and looking great in terms of the smaller details - as a thanks heres a little wip screen snip from what i'm working on so you can see how its been implemented into the shot
^_^

thanks again i really appreciate it.
ant

 

shot1001_stg02 (00140).jpg

  • Like 1
Link to comment
Share on other sites

Glad it helped Anthony, that shot is looking so badass!! May I ask what project this is for?  :) Oh, and is this a Mantra render or?

As for the added 102.377, it's a random number that's added to make sure the rand function seed is a float value instead of an integer, and also to spread the seed numbers out. The help for the "rand" function states that non-integer numbers work best for the argument, but @ptnum will return integer values. I may be misinterpreting this though, so hopefully a Vex guru will set me straight here if I'm way off base!

Another thing I've found useful when up-rezzing grains is to use the point velocities vector length to spread the replicated points further away from the source grain point, helps avoid the blobby look with free-flying grains. Let me know if you're interested in this technique and I'll whip out a quick example.

--Dave

  • Like 2
Link to comment
Share on other sites

@Dave Stewart - yes it was a massive help!  I've since doubled the number of particles i had in that shot to 80 in the point replicate node hehe - i spaced them out a bit using the shape and noise subtabs that are in there - beyond that i dont know many other ways so yes if you have a quick example file i'd love to see that :)

regarding the project its for a short marvel fan film i'm working on called "Iron Man Gamma Protocol" - its a fan film i started about 2 years back :huh: ...but due to life/work/family/other-commitments getting in the way i had to put it down in 2015 as we went to spain then canada for various games and feature film work, and finally back to UK again where i've been freelancing since lol.  I decided it was time to learn something new (must be a turning 40 thing) and i've been wanting to pick up houdini for so long now so i've commited some time each week whilst working from home to treat it like a little part time job and learn some tricks with it and hopefully more down the line.  I'm utterly loving houdini tho - every time i step in the software i smile at this epic toolkit (plenty of headscratch moments too of course) but compare that to maya where i tend to just now groan.  Gamma protocol is rendered in maya with vray altho i just fired out  the grains for this shot using mantra and it blasted through them and looks way better :D

 

I'm literally working on the last few shots and it'll be grading time and i can release it.  The score and soundfx are sounding superb too!  the goal for me was to sort of do a benchmark for marvel fanimation film being a huge nerd/fan of them :)


heres a little teaser... looks lovely in 2k and on a 4k telly it even holds up!  :P


 

  • Like 2
  • Sad 1
Link to comment
Share on other sites

oh one other grains related question - right now my grains render as spheres - i also see them as sprites.

so i went and made my own custom.pic sprite which i loaded into the sprite path ... but it doesn't seem to render the same way :/  any ideas on how i can do this as it would be good to get some sprite variation in there from the default spheres?
sprites01.JPG

sprites02.JPG

Link to comment
Share on other sites

Excellent work, excited to see the finished short! I'm always amazed by folks like yourself that can keep long-term focus going on a project like this and actually finish it. :)

Funny on the turning 40 thing, I'm in the same boat, and was also getting pretty bored after using 3DSMax since v1.

I've attached a setup I'm playing around with that might give you some ideas. Needs more work to be sure and there are probably better ways to achieve this, but it's a start. Be warned that it will want to cook the entire 100 frames no matter what frame you're on, due to a time shift node I have in there. Let me know if you have any questions about the setup...

Can't help ya with the sprite rendering unfortunately, but isn't there a sprite SOP as well? May need to figure that out to actually render the sprites.

--Dave

DStewart_GrainsUpresExample.hip

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

 

Ok, after maybe one or two thousand nodes and many different techniques, my env is looking already great and close to my target. Good

What about if I want to add the cheery on the top and run a *large scale* sand grain simulation there to get a natural sand accumulation over all my env, with a custom building colliding optimize geo of course, the ones i already used to run few simulations (bullets base).

A more realistic effect that running a scatter in a loop.

My grain setting up is working but obviously, that's quite slow and the conversation to VDB is also quite heavy.

Just curious if one f you have already done some large scale grain simulation on a complex full env (let say 400m on 400m with human hard surface structures on it, not only a cliff :) )

 

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

 

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...