3ds max – Model a terrain from an Autocad topographical plan file

Software:
3ds max 2019

To model a terrain form an DWG (Autocad) file containing a topographical plan:

  1. Import the DWG file to into the 3ds max scene, and move the plan to the center of the 3ds max scene if necessary.
  2. Select the VIZBlock object and extract its linked geometry:
    Annotation 2019-12-12 181552.jpg
  3. Right click the Linked Geometry object and select:
    Convert To: Editable Spline
    Annotation-2019-12-12-181552b.jpg
  4. Enter Spline editing mode, select all the splines that are not part of the topography, and delete, or detach them so only the terrain ‘height lines’ will remain.
    Annotation 2019-12-12 182223.jpg
    Annotation 2019-12-12 182255.jpg
  5. With the topographical plan editable spline selected,
    Choose Create > Compound Objects > Terrain
    Annotation 2019-12-12 182640.jpg
  6. A Terrain object is now created:
    Annotation 2019-12-12 182716.jpg

To retopologize the terrain mesh to more usable quad polygon mesh:

  1. Create a new Plane primitive above the terrain mesh, slightly smaller at the sides, that has the wanted polygon resolution:
    Annotation 2019-12-12 183519.jpg
  2. From the Top view (important), with the new plane selected, choose:
    Create > Compound Objects > Conform:
    Annotation 2019-12-12 183607.jpg
  3. Set the creation method to ‘Move“, click Pick Wrap-To Object and than click the terrain mesh.
    It will now take some time for the new conformed mesh to be calculated..
    When the new object is ready, right click the viewport to exit the object picking mode.
    Annotation 2019-12-12 184044.jpg
  4. The Conform object is no ready, and contains both the terrain mesh and the new conformed quad polygon mesh:
    Right click it and choose:Convert To: Editable PolyAnnotation 2019-12-12 184552.jpg
  5. In Element editing mode, select the terrain mesh part and delete it to remain only with the new quad polygon mesh:
    Annotation 2019-12-12 184621.jpg
  6. Fix non conformed mesh parts by either moving or deleting them:
    Annotation 2019-12-12 184655Annotation 2019-12-12 184719
  7. The new retopologized terrain is ready:
    Annotation 2019-12-12 184752.jpg

 

The example demonstrated here is a DWG file by Jose Vega, free to download from Bibliocad.com

Blender – Modeling character clothes using cloth simulation

Software:
Blender 2.8

This character project is the first one in which I’m using physical cloth simulation in Blender to model the character’s clothes at proxy quality (they will be detailed further manually). learning this approach to clothes modeling demanded a lot experiments, trials and errors to get it right, in this short article, I’ll try to provide some insights, tips, and settings that can speed up the process.

Watch the full modeling process here

General notes and tips:

  1. When modeling the basic shape of the cloth try to “cut” a realistic cloth pattern for your desired cloth model. if you’ll search images on the web for “trousers cutting pattern” or “coat cutting pattern” you’ll find many examples.
    * See images below
  2. Create proper UVs for the cloth mesh when its still flat (before the simulation)
  3. In Blender cloth simulation, isolated edges in the mesh (edges without polygons) are treated as sawing springs, and are an important part of the cloth setup.
  4. Use a low poly proxy model for your characters body mesh, it will speed up the cloth simulation.

Early experiments:

In this experiment I used a simple tubular pants-like mesh that I quickly modeled around the character’s legs and pelvis (not a realistic cloth cutting pattern), with the top (weist) vertices defined as a vertex group with shrinking cloth property.
The result looks like training suit pants. it wasn’t at all what I wanted for this character, but I actually like it and probably will use such pants on other characters or on this one as a secondary look.

cloth_study

In this experiment I started trying to model an actual man’s trousers cutting pattern, and as you see, it still needs tweaking.

Blender_Cloth

This experiment is beginning to produce reasonable results, the undershirt initial shape is still cut too low at the back.
* Note that there is an animated belt collision object to bring the undershirt to it’s shape at the weist

Blender_Cloth_B2

Final Settings:

The final undershirt initial model:

Annotation 2019-12-08 120355

The final pants initial model:
* Note that the belt mesh is a vertex group defined a fixed in the cloth simulation, and that it’s split to parts corresponding to the edges of the pants shape that need to be sawed to it. (see the process here)

Annotation 2019-12-08 120618

The full final cloth setup for the character. the setup includes a low poly collision object of the whole character and shoes, undershirt mesh, pans mesh and animated (contracting) belt collision for the undershirt:

Annotation 2019-12-08 120941

The final cloth simulation:

cloth

cf

cb

Cloth Settings:

Cloth simulation settings for the undershirt:

cloth_undershirt

Cloth simulation settings for the pants:

cloth_pants.jpg

Related posts:
Blender 2.8 Character Project

Simple Snow Material in VRay for 3ds max

Software:
3ds max 2019 | V-Ray Next

A simple way to create a snow material in V-Ray for 3ds max is to combine a VRayFastSSS2 material with a VRayFlakesMtl using a VRayBlendMtl.
The VRayFastSSS2 creates the soft translucent shading for the snow, and the VRayFlakesMtls adds sparkling highlights.

  • Note that depending on the scene and view scale,
    The VRayFlakesMtls ‘flake glossiness’, ‘flake density’ and ‘flake size’ have to be tweaked to achieve the wanted result.

Untitled-1

Untitled-2

Untitled-3

3ds max Island / Seashore opacity underwater tip

Software:
3ds max 2016

When creating a surface submerged in sea water,
Theoretically, it’s the Volume Absorption or ‘Fog‘ of the water shader that should do cause the surface to disappear under water.
But in many cases that doesn’t work well because we don’t actually model enough extended surface under the water for it to completely disappear without seeing the surfaces geometric edges that spoil the result.

One of the oldest tricks in the book is to use a Gradient Ramp map in the surface’s Opacity channel to make it gradually disappear before the geometry ends.

This can be done in most  3d software and render engines, I’m demonstrating it here using 3ds max and V-Ray:

Island

 

Customizable Photo-realistic Car-paint shader for Cycles

Software:
Blender 2.8 | Cycles Render

CGL Car Paint Presets Pack 1.0 is a highly customizable photo-realistic car-paint shader I developed for Blender & the Cycles render engine.
The shader has built-in realistic effects like color blending, metallic flakes, clear-coat etc.
And ships with 32 ready-to-use real world car paint material presets.

CGL Car Paint Presets Pack 1.0 is available on Blender Market:
https://www.blendermarket.com/products/cg-lion-car-paint-presets-pack-1

CGL_CarPaint.jpg

CGL_Cycles_Car_Paint_Presets_Pack_1.0_No_Numbers

This slideshow requires JavaScript.

Related posts:
Realistic Spotlights for Blender & Cycles
Complex Fresnel texture for Cycles
Optimized Architectural Glazing Shader for Cycles
Procedural Wood Shader for Cycles

Python for 3ds max – Mesh manipulation

Software:
3ds max 2019

An example of creating a mesh ripple deformation using Python for 3ds max:

mesh_manipulation.gif

Script steps:

  1. Define the effect intensity and a helper point object that will serve as the effect center.
  2. Collapse the object to an Editable-Mesh so its vertices will be accessible by Python.
    Note that the Node‘s Object has to be cast as a TriObject, to access the object’s Mesh data.
  3.  Loop through the Mesh’s vertices, get their world position, and set a new Z position as a sine function of the distance from the effect center.
import math
from MaxPlus import Factory
from MaxPlus import ClassIds
from MaxPlus import INode
from MaxPlus import TriObject
from MaxPlus import Matrix3
from MaxPlus import Point3

# Intensity:
effecr_mult = 1.0

# Effect center:
effector = INode.GetINodeByName('Point001')
effect_pos = effector.GetWorldPosition()

# Prepare object and eccess it's mesh data:
node = INode.GetINodeByName('Teapot001')
new_edit_mesh_mod = Factory.CreateObjectModifier(ClassIds.Edit_Mesh)
node.AddModifier(new_edit_mesh_mod)
node.Collapse(True)
node_tm = node.GetWorldTM()
node_pos = node.GetWorldPosition()
obj = node.GetObject()
triobj = TriObject._CastFrom(obj)
mesh = triobj.GetMesh()

# Process the object's vertices:
for i in range(mesh.GetNumVertices()):
     # Get vertex in world space
     vert_pos = mesh.GetVertex(i)
     vert_world_pos = node_tm.VectorTransform(vert_pos)
     vert_world_pos = vert_world_pos + node_pos
     # Get vertex distance from effect center:
     diff_vec = vert_world_pos - effect_pos 
     diff_vec.Z = 0
     dist = diff_vec.GetLength()
     # Set new vertex position:
     mesh.SetVert(i,vert_pos.X,vert_pos.Y,vert_pos.Z + math.sin(dist)*effecr_mult)

* note that when copying and pasting a script from this example, the indentation may not be pasted correctly.

Related Post:
Python for 3ds max – Animated Mesh

Python for 3ds max – Animated Mesh

Software:
3ds max 2019

This is an example of procedurally animating a mesh’s vertices via Python script.

Vert_Anim.gif

Notes:
1. The model has to be converted to Editable Mesh before the script is run.
* unless the scrip will be extended to do it.
2. The model must be selected for the script to work.

import MaxPlus
import math
from MaxPlus import INode
from MaxPlus import TriObject
from MaxPlus import SelectionManager
from MaxPlus import Factory
from MaxPlus import Animation
from MaxPlus import Point3
from MaxPlus import Control

ticks_frame = 160

#Selection
sel = []
for n in SelectionManager.Nodes:
    sel.append(n)
node = sel[0]

#Setup Controllers
obj = node.GetObject()
Tri = TriObject._CastFrom(obj)
mesh = Tri.GetMesh()
num_verts = mesh.GetNumVertices()
mesh_anim = obj.GetSubAnim(0)
pnt_ctrl = Factory.CreateDefaultMasterPointController()
node.AssignController(pnt_ctrl,1)
for i in range(num_verts):
    bezp3 = Factory.CreateDefaultPoint3Controller()
    bezp3.SetPoint3Value(mesh.GetVertex(i))
    mesh_anim.AssignController(bezp3,i)

#Animation
Animation.SetAnimateButtonState(True)
for t in range(100):
    time = t * ticks_frame
    Animation.SetTime(time)
    mesh_anim.AddNewKey(time,0)
    for i in range(num_verts):
        vert_anim = mesh_anim.GetSubAnim(i)
        vert_ctrl = Control._CastFrom(vert_anim)
        vert_val = mesh.GetVertex(i)
        vert_val.SetZ(vert_val.GetZ() + math.sin(((Animation.GetTime()*0.5)/(ticks_frame))+i))
        vert_ctrl.SetPoint3Value(vert_val)
Animation.SetAnimateButtonState(False)

* note that when copying and pasting a script from this example, the indentation may not be pasted correctly.

Related:
Python for 3ds max – Mesh manipulation

V-Ray – Underwater rendering tip

Software:
3ds max 2019 | V-Ray Next

I decided to do some test renders for an underwater swimming pool scene with 3ds max and V-Ray,
And happily found out that my initial geeky academic approach to the subject was actually outdated and unnecessary.
> look down at the bottom for the correct sample renders.

In this example there is a VRaySun & VRaySky for the daylight render setup and a Caustics calculation to create the light lensing effects on the under water surfaces.

The wrong way:
Having ancient habits in the subject,
I first flipped the water\air surface’s normals so they’ll point down into the water (towards the camera), And set the water material’s IOR to 0.75 ( 1 / 1.333 ) so instead of being an “air to water” material, it will become a “water to air” material.
This produced a non realistic result.
Viewed from underwater, the air surface should have a very dominant mirror reflection at most angles.Untitled-1.jpg

 

The Correct Way:
It seems that in V-Ray nothing special should be setup in terms of the water material.
You don’t have to create a special water-to-air material like I thought at first.
Its a regular water material, and the water surface is facing upwards like it should,
And when the camera is underwater it renders the water surface correctly as an air surface from withing the water.

The pool water material setup:
Note that Affect Shadows is turned off so the surface will generate caustics and not fake transparent shadows, and that Reflect on back side is turned on to produce more detailed reflections.
mat.jpg

This produced the following result in which the reflection/refraction look correct but the water is still too simple:Untitled-2.jpg

Improved wave deformation for the water surface, added detail using a Noise bump in the water material and a sense of depth with Volumetric Fog:Untitled-4.jpg

Finally remembered to activate Reflect on back side at the water material to add more realistic reflection detail, some basic contrast in the V-Ray VFB,
And a shark because I couldn’t help it…. 😀
Untitled-6.jpg

Related:
> Understanding Transparency Render Settings
> Island / Sea-shore tip

 

 

Getting Maya 3D Paint to work

Software:
Maya 2018

Steps needed for Maya 3D Paint to work:

  1. Set a project folder and save your scene.
    * If your painting into an existing texture you can skip this step.
  2. Make sure your model has UV coordinates.
  3. Make sure your model has a basic Lambert material.
    * If you’re using a different material/shader on your model,
    Temporarily switch to Lambert just for the texture painting operation,
    And connect the original shader with the painted texture map to the surface shader input of the shading group after you’re done painting.
  4. In the Rendering tab toolbar, Double-Click the 3D Paint tool button to activate 3D Paint and also open its tool settings window.
  5. Make sure the object is selected.
  6. In the 3D Paint Settings window, go to the File Textures part,
    Choose a material attribute to paint to.
    * this would usually be Color because we are using Lambert temporarily anyway.
  7. Click Assign/Edit Textures to open the Assign/Edit Textures dialog,
    Choose a resolution and a file format for the new texture,
    And than click Assign/Edit Textures button at the bottom of the Assign/Edit Textures dialog to create the new texture and close the dialog.
    * If you already connected an existing texture file to the Lambert shader’s Color input you can skip this step.
  8. Check Update on stroke and Save texture on stroke.
  9. Set the viewport to Textured display mode.
  10. Set paint brush settings.
  11. Click the 3D Paint tool button to activate it and paint on the model surface.

Untitled-1

V-Ray Next’s PBR’ness

Software:
3ds max 2019 | V-Ray Next

A quick test of V-Ray Next‘s PBR* workflow,
Namely designing materials while previewing them using V-Ray,
Defining the material properties using the new (to V-Ray) Metalness attribute, and using Roughness rather than Glossiness, shows good results IMO.

* It should be noted that although we got used to referring to the base-color / metallness / Specular material interface as “PBR”, it is actually a principled material interface developed by Disney animations studios.

Results are generally consistent through Blender & Cycles, Maya & Arnold, and UE4.

Untitled-1.jpgUntitled-3

Untitled-4

Untitled-2

 

Related Posts:

  1. V-Ray Next – Metalness
  2. Metal In UE4
  3. Fresnel Reflections