Jump to content
3DCoat Forums

Draft angle


micro26
 Share

Recommended Posts

  • Advanced Member

Hi all , i just found a code block in Shaders/Templates/mcubes_ps.glsl/hlsl   that colors the draft angle  when switching to undercuts or bassrelief tools.

Can someone help me  have the draft angle displayed for every sculpting tool ?

#ifdef BAS_RELIEF
    vec4 nrm=vec4(GlobalNormal,0.0);
    float dp=dot(normalize((g_WorldMatrixInverse*nrm).xyz),BasReliefDir);
    //float dp=dot(GlobalNormal,BasReliefDir);
#ifdef UNDERCUTS
    vec3 idn = vec3(1.0,1.0,1.0);
    float tap = sin(TaperingAngle*0.0174533);
    vec3 c1 = lerp(idn, vec3(1.4,0.7,0.7),saturate((dp+tap)*80.0-1.5));
    vec3 c2 = lerp(idn, vec3(0.7,0.7,1.4),saturate((tap-dp)*80.0-1.5));
    ColorModulator *= lerp(c1,c2,saturate(dp*50.0+0.5));
#else
    ColorModulator *= lerp(vec3(1.0,1.0,1.0), vec3(1.4,0.7,0.7),saturate((sin(TaperingAngle*0.0174533)-dp)*80.0-1.5));
#endif    
#endif //BAS_RELIEF

Thanks in advance.

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.

 Share

×
×
  • Create New...