Jump to content

I need some advice on the ripples of the ship.


eunchae

Recommended Posts

Alternatively remap and average out directions and distances to points across a height field:

image.png.63a1f5e3d4476bed3732ab3f85eb6d65.png

float scale = chf('scale');
float range = chf('range');

float disps[] = {};
int pts[] = nearpoints(1, v@P, range * 4.0);
foreach(int pt_near; pts){
    vector pos = point(1, 'P', pt_near);
    vector nml = point(1, 'N', pt_near);
    float pscale = point(1, 'pscale', pt_near);
    vector dir = normalize(pos - v@P);
    float angle = fit11(dot(nml, dir), 0.0, 1.0);
    float dist = distance(pos, v@P);
    float shape = chramp('shape', angle);
    float dist_mod = dist * shape * pscale;
    float mask = 1.0 - smooth(0.0, range, dist);
    float wave = sin(dist_mod * 0.02);
    float height = 1.0 - chramp('height', angle);
    float disp = height * mask * scale * wave;
    append(disps, disp);
}

f@height = avg(disps);

 

boat_waves_VEX.hiplc

  • Like 2
Link to comment
Share on other sites

On 2021. 9. 27. at 6:05 PM, konstantin magnus said:

Alternatively remap and average out directions and distances to points across a height field:

image.png.63a1f5e3d4476bed3732ab3f85eb6d65.png


float scale = chf('scale');
float range = chf('range');

float disps[] = {};
int pts[] = nearpoints(1, v@P, range * 4.0);
foreach(int pt_near; pts){
    vector pos = point(1, 'P', pt_near);
    vector nml = point(1, 'N', pt_near);
    float pscale = point(1, 'pscale', pt_near);
    vector dir = normalize(pos - v@P);
    float angle = fit11(dot(nml, dir), 0.0, 1.0);
    float dist = distance(pos, v@P);
    float shape = chramp('shape', angle);
    float dist_mod = dist * shape * pscale;
    float mask = 1.0 - smooth(0.0, range, dist);
    float wave = sin(dist_mod * 0.02);
    float height = 1.0 - chramp('height', angle);
    float disp = height * mask * scale * wave;
    append(disps, disp);
}

f@height = avg(disps);

 

boat_waves_VEX.hiplc

Thank you. If I have to ask you one more thing, can you make it like the last pattern in the video? Even if I use ripple sop, such a shape does not come out.

 

Link to comment
Share on other sites

  • 11 months later...

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