Personal tools

VEXMountainSOP

From Odwiki

Jump to: navigation, search

The VEX Mountain SOP is one of the VEXSops which comes with Houdini.

The SOP provides a simple way of displacing points based on a 3D noise. This is very similar to a DisplacementShader which does noise based displacement, but instead it works on the model's points.

The SOP can be broken into two distinct sections

   nval = 0;
   scale = height;
   for (i = fracP += frac_depth; i-- > 0; scale *= rough)
   {
            if (ntype == "alligator")  nval += scale*anoise(PP);
       else if (ntype == "sparse")     nval += scale*snoise(PP);
       else                            nval += scale*noise0(PP);
       PP *= 2;
   }
   P += normalize(N)*nval;

This part of the SOP is a standard fbmNoise loop which generates a displacement amount. The point's position is then modified by moving it along the direction of the normal.

The second part is used for coloring the points. The points are simply colored using a spline lookup based on the noise value.