Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Density mult in Y:
- f@density = chramp("density",f@density);
- f@density *= ch('scale');
- f@density *= 1.0 - pow(relbbox(v@P).y,ch('falloff'));
- *********************************************************************************
- Density mult based in proximity to point:
- vector lineOfSight = point( 1, "P", i@ptnum );
- int handle = pcopen( 1, "P", v@P, chf( "radius" ), 1000 );
- float dist = pcimportbyidxf( handle, "point.distance", 0 );
- pcclose( handle );
- float condition = ( v@P.y >= ( chf( "radius" )/ dist + chf( "falloff" ) ) ) ? ( f@density *= pow( clamp( f@density, 0.1,0.3 ) + pow( chf( "fade" ),chf( "exp_padding" ) ), chf( "exp" ) )) : ( f@density = f@density );
- ***************************************************************************************************************
- Stamp points:
- f@density = 0.0f;
- f@temperature = 0.0f;
- vector relVoxel = relbbox(0,v@P);
- int pc = pcopen(1,"P",v@P,(ch('voxel_size')/2.0)*1.4143,chi('max_points'));
- while (pciterate(pc)) {
- vector point;
- pcimport(pc,"P",point);
- vector relPoint = relbbox(0,point);
- // only stamp points immediately in this voxel
- if (int(relPoint.x * @resx) != int(relVoxel.x * @resx))
- continue;
- if (int(relPoint.y * @resy) != int(relVoxel.y * @resy))
- continue;
- if (int(relPoint.z * @resz) != int(relVoxel.z * @resz))
- continue;
- float sample;
- pcimport(pc,"temperature",sample);
- f@temperature += sample;
- pcimport(pc,"density",sample);
- f@density += sample;
- }
- //f@temperature /= float(pcnumfound(@ptnum));
- //f@density /= float(pcnumfound(@ptnum));
- //f@density = clamp(f@density, 0.0f, 1.0f);
- *************************************************************************************
- ***Blur by density***
- float fps = 1.0/ch("fps");
- vector vel = volumesamplev(1, "vel", v@P);
- float steps = max(float(ch("steps")), 2);
- float d_mult = 1.0/steps;
- float s_mult = -d_mult*0.5;
- float sum = 0.0;
- int i;
- for(i=0; i<steps; ++i)
- {
- float d = volumesample(0, "density", v@P - vel*fps*ch("length")*s_mult);
- sum += d * d_mult;
- s_mult += d_mult;
- }
- f@density = sum;
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
- *************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement