The title says it all? Displacement and normal displacement, now in Welder. This is definitely a powerful primitive. I've been playing around with adding grooves and a hangar to the existing ship:
And the code:
Like everything else, the code for displacement is very intuitive and fast to write: you just wrap a code block in the displace function, then provide the displacement callback as the second code block. Welder maps the vertex positions to the variables x, y, and z, as well as the normal to nx, ny, and nz. It records any changes made to x, y, and z, updating the vertices accordingly. In the code above, the outer displacement adds a hangar (the big dent in the side of the ship), and the inner displacement adds the vertical grooves along the hull.


No comments:
Post a Comment