How to control density with ramp, and ramp rotation?

Recommended Posts

Posted (edited)

Hi!

My goal is to have control over volume density with ramp that is 45degree rotated , so to have ability set higher density at areas near corner of the object.

I will upload scene file and screenshot , I was trying all day today but without success , I had managed what I wanted but it was done without ramp control , I need ramp control and ramp rotation ability.

If you can tell me how to do that without opening that file it is also greatly appreciated , I uploaded scene in case you want to look inside my beginner skills..

test.hipnc

Edited by xanter

Share on other sites
Posted (edited)

Hi,

one possible way might be using a curve to capture the u-attribute (with xyzdist() in a volume wrangle for example).

Here is an example, using a float ramp (for density control) and an external curve for rotational control.

Edited by Aizatulin

Share on other sites
Posted (edited)

vex vex vex )))) hate it , I mean I'm sure something is possible to do in VOPs without going deeper into coding

VOP has tons of nodes and ramp node but I can't and I'm fighting that goal all day today.

Thank you a lot for file anyway!

meanwhile , I will try VOPs again  ..  ph... my head is cracking by pieces. I'm new at H so not surprised I'm having a bad day with it )

Edited by xanter

Share on other sites
Posted (edited)

You can do the same in VOP, it is only about the xyzdist() function, which is doing all the work in the background. The only thing is, that you need a second input curve. If interested, here is a VOP version.

Probably there simpler more straightforward solutions.

Edited by Aizatulin
• 1

Share on other sites

any chance to do that without including additional object like line? I mean just with ramp node in VOPs and rotate it after custom ramp is done. (I need a custom ramp)

The thing is I want ramp over density control becasue it's not 100% gradient from 0 to 1 , I need 1 density till the center of a box and then from center to peak corner it increases to 2 lets say

again thank you for help.

Share on other sites
Posted (edited)

The ramp is just a function, which takes a float value. In my version it is the u-value of the position on the curve, where the point has its closest distance to. For example, if this is the center of a line (where the point has its closest distance) the

u-value is 0.5, The rotational effect comes from the input value (which comes from the curve) and not from the ramp.

Another approach can be just rotating the box (outside) and after this applying the ramp function and then rotate the box back. You can just use the vop from your example. I'm strongly biased to VEX (it is much faster and easier to use - but this

just my personal opinion).

Here is another file (1 line VEX to capture input and set detail attribute)

Edited by Aizatulin

Share on other sites

Hi,

this is just a concept of how to use ramp for rotation control, but i think a float parameter is more convenient.

test_01.hipnc

Share on other sites
Posted (edited)
4 hours ago, vicvvsh said:

Hi,

this is just a concept of how to use ramp for rotation control, but i think a float parameter is more convenient.

that is amazing and what I was expecting, we have rotation control , now the thing here is to control the density with ramp.

you named second ramp node "density_" , but it has no affect on density of volume .

P.S

I thought it has no affect to ramp but looks like it's a bug , I'm changinf density in name parrameter and it works

so you have to change a name and get it back again in order to see changes in density ramp , I need to report it I guess.

Does your houdini version density ramp updates instantly while changing ramp curve ?

Edited by xanter

Share on other sites
1 hour ago, xanter said:

you named second ramp node "density_" , but it has no affect on density of volume .

I named ramp that i added as "rot_ramp" (actually as "rot_amp" but that was a typo)

1 hour ago, xanter said:

Does your houdini version density ramp updates instantly while changing ramp curve ?

Yes it does, it works as should be, H 18.0.524

Share on other sites

what tha hell is wrong with my version then ...((( Im changing ramp and density stays same without changes , I have to rename ramp name to have changes updated in viewport..  damn .