Start with this task
How do you build a readable coastal landmark?
An island diorama for a game map, with a lighthouse rising above a terraced shore.
Blender 5.3.0
No model or texture download is needed. Use the lesson below to build this scene in three passes, from the first shapes to the camera view. Pause between passes to inspect the model and materials.
Select a product name for its manual. In Blender, open Edit → Preferences → Add-ons and enable the products listed here.
Save your current file and choose File → New → General. Open the Scripting workspace, choose New in the Text Editor, then expand the scene recipe below. Copy all of it and paste it into the Text Editor.
import bpy
import importlib
import math
import random
from math import cos, sin, pi, tau
from mathutils import Vector, Quaternion
def product_module(path):
base, _, sub = path.partition('.')
actual = next((a.module for a in bpy.context.preferences.addons if a.module.rsplit('.', 1)[-1] == base), None)
if actual is None:
raise RuntimeError('Enable the required SmartTools extension in Preferences: ' + base)
return importlib.import_module(actual + ('.' + sub if sub else ''))
def product_symbol(path, name):
module = product_module(path)
if hasattr(module, name):
return getattr(module, name)
return importlib.import_module(module.__name__ + '.' + name)
def drawing(scene):
builders=product_module('smart_shader_suite.builders')
def bx(name, loc, dim, m, r=0.04):
bpy.ops.mesh.primitive_cube_add(size=1, location=loc)
o = bpy.context.object
o.dimensions = dim
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
return finish(o, name, m, r)
def finish(o, name, m, r=0):
o.name = name
o.data.materials.append(m)
if r:
be = o.modifiers.new('Highlight radius', 'BEVEL')
be.width = r
be.segments = 4
be.harden_normals = True
o.modifiers.new('Planar normals', 'WEIGHTED_NORMAL')
return o
def cyl(name, loc, r, d, m, rot=(0, 0, 0), edge=0.015):
bpy.ops.mesh.primitive_cylinder_add(vertices=80, radius=r, depth=d, location=loc, rotation=rot)
o = bpy.context.object
for f in o.data.polygons:
f.use_smooth = len(f.vertices) == 4
return finish(o, name, m, edge)
def rod(name, a, b, r, m):
v = Vector(b) - Vector(a)
o = cyl(name, (Vector(a) + Vector(b)) / 2, r, v.length, m, edge=min(r / 3, 0.024))
o.rotation_euler = v.to_track_quat('Z', 'Y').to_euler()
return o
def line(name, coords, r, m):
cu = bpy.data.curves.new(name, 'CURVE')
cu.dimensions = '3D'
cu.resolution_u = 16
cu.bevel_depth = r
cu.bevel_resolution = 4
sp = cu.splines.new('BEZIER')
sp.bezier_points.add(len(coords) - 1)
for (p, c) in zip(sp.bezier_points, coords):
p.co = c
p.handle_left_type = 'AUTO'
p.handle_right_type = 'AUTO'
o = bpy.data.objects.new(name, cu)
scene.collection.objects.link(o)
cu.materials.append(m)
return o
def mesh(name, loc, verts, faces, m):
me = bpy.data.meshes.new(name)
me.from_pydata(verts, [], faces)
me.update()
o = bpy.data.objects.new(name, me)
scene.collection.objects.link(o)
o.location = loc
for f in me.polygons:
f.use_smooth = True
return finish(o, name, m)
def mat(name, c, metal=0, rough=0.4, em=0):
m = bpy.data.materials.new(name)
m.use_nodes = True
b = m.node_tree.nodes.get('Principled BSDF')
b.inputs['Base Color'].default_value = (*c, 1)
b.inputs['Roughness'].default_value = rough
b.inputs['Metallic'].default_value = metal
if em:
b.inputs['Emission Color'].default_value = (*c, 1)
b.inputs['Emission Strength'].default_value = em
return m
def shader(name, fn, c, **props):
m = bpy.data.materials.new(name)
getattr(builders, fn)(m, dict(base_color=[*c, 1], **props))
assert any((n.type == 'BSDF_PRINCIPLED' for n in m.node_tree.nodes))
return m
def lacquer(name, c):
return shader(name, 'build_auto_clearcoat', c, roughness=0.24, metallic=0.18, clearcoat=0.8, clearcoat_roughness=0.14, flake_scale=240, flake_bump=0.008)
def aim(o, p):
o.rotation_euler = (Vector(p) - o.location).to_track_quat('-Z', 'Y').to_euler()
def light(name, pos, target, power, col, w, h=None):
d = bpy.data.lights.new(name, 'AREA')
d.energy = power
d.color = col
d.shape = 'RECTANGLE'
d.size = w
d.size_y = h or w
o = bpy.data.objects.new(name, d)
scene.collection.objects.link(o)
o.location = pos
aim(o, target)
def shoot(pos, target, scale, lens=None):
cd = bpy.data.cameras.new('Art direction')
cam = bpy.data.objects.new('Art direction', cd)
scene.collection.objects.link(cam)
scene.camera = cam
cam.location = pos
aim(cam, target)
if lens:
cd.lens = lens
else:
cd.type = 'ORTHO'
cd.ortho_scale = scale
bpy.context.view_layer.update()
cd.smart_camlight_settings.rig_target_distance = (Vector(target) - cam.location).length
assert bpy.ops.smart_camlight_suite.create_camera_rig(camera_name=cam.name) == {'FINISHED'}
assert any((c.type == 'TRACK_TO' and c.target for c in cam.constraints))
world = bpy.data.worlds.new('Ambient')
scene.world = world
world.use_nodes = True
world.node_tree.nodes['Background'].inputs[0].default_value = (0.26, 0.34, 0.44, 1)
world.node_tree.nodes['Background'].inputs[1].default_value = 0.27
scene.render.engine = 'CYCLES'
scene.cycles.samples = 24
scene.cycles.use_denoising = True
scene.render.threads_mode = 'FIXED'
scene.render.threads = 5
scene.render.resolution_x = 1120
scene.render.resolution_y = 730
scene.render.resolution_percentage = 100
scene.render.image_settings.color_mode = 'RGB'
def cone(name, loc, r1, r2, h, m, segments=16):
bpy.ops.mesh.primitive_cone_add(vertices=segments, radius1=r1, radius2=r2, depth=h, location=loc)
return finish(bpy.context.object, name, m)
def model_line(name, points, r, m):
return line(name, points, r, m)
black = mat('Graphite', (0.016, 0.022, 0.029), 0.55, 0.28)
rng = random.Random(29)
kernel = vars(product_module('smart_geometry_suite.max_procedural_primitives.mesh_generators'))
raw = kernel['make_terrain_v2'](dict(size=8.5, segments=72, seed=43, height=0.9, contours=3, terrace=0.7, smooth_steps=1))
cols = [mat('Sand', (0.81, 0.68, 0.43)), mat('Basalt', (0.2, 0.25, 0.22)), mat('Sunlit cliff', (0.37, 0.35, 0.27)), mat('Coastal turf', (0.34, 0.46, 0.19)), mat('Moss', (0.24, 0.35, 0.16))]
def shore(x, y, z):
a = math.atan2(y / 2.18, x / 3.4)
rad = math.hypot(x / 3.4, y / 2.18)
edge = 1 - rad + 0.105 * sin(3 * a + 0.5) + 0.055 * cos(5 * a - 0.5)
return -0.15 + min(1, max(0, edge / 0.27)) * (0.7 + z * 0.76) + 0.12 * sin(x + 0.65) * max(0, 1 - rad)
pts = [(x, y, shore(x, y, z)) for (x, y, z) in raw['verts']]
terr = mesh('Terraced coastline', (0, 0, 0), pts, raw['faces'], cols[0])
for m in cols[1:]:
terr.data.materials.append(m)
for p in terr.data.polygons:
z = p.center.z
p.use_smooth = False
p.material_index = 0 if z < 0.17 else rng.choice((1, 1, 2)) if p.normal.z < 0.66 else 4 if z > 0.88 else 3
ocean = mat('Lagoon', (0.043, 0.32, 0.36), 0.32, 0.28)
bx('Sea', (0, 0, -0.3), (200, 200, 0.6), ocean, 0)
opal = mat('Sea foam', (0.58, 0.85, 0.76), 0.05, 0.46)
cream = mat('Limewash', (0.91, 0.79, 0.54))
rust = lacquer('Signal vermilion', (0.68, 0.09, 0.025))
dark = mat('Deep evergreens', (0.042, 0.15, 0.103))
green = mat('Pine needles', (0.067, 0.225, 0.13))
lamp = mat('Lantern', (0.98, 0.61, 0.13), 0.1, 0.22, 0.8)
def height(x, y):
near = min(pts, key=lambda p: (p[0] - x) ** 2 + (p[1] - y) ** 2)
return near[2]
for j in range(39):
a = tau * j / 39 + rng.uniform(-0.03, 0.03)
r = 1.14 + 0.1 * sin(a * 3 + 0.5) + rng.uniform(0.02, 0.22)
x = r * cos(a) * 3.4
y = r * sin(a) * 2.18
d = rng.uniform(0.11, 0.28)
model_line('Broken wave', [(x - d, y - 0.018, 0.021), (x, y + 0.025, 0.022), (x + d * 0.86, y, 0.021)], 0.009, opal)
light('Morning softbox', (-4, -5, 8), (0, 0, 1), 960, (1, 0.88, 0.69), 5.5)
light('Sky fill', (3, 4, 8), (0, 0, 0), 760, (0.68, 0.84, 1), 7)
shoot((7, -10, 7.6), (0, 0, 0.85), 9.8)
yield
for i in range(35):
x = rng.uniform(-2.55, 2.15)
y = rng.uniform(-1.3, 1.28)
z = height(x, y)
if z < 0.59 or (x - 1.03) ** 2 + (y - 0.1) ** 2 < 0.76:
continue
h = rng.uniform(0.28, 0.67)
cone('Lower pine boughs', (x, y, z + h * 0.29), h * 0.3, 0, h * 0.72, green, 8)
cone('Upper pine boughs', (x, y, z + h * 0.59), h * 0.23, 0, h * 0.78, dark, 8)
x = 1.03
y = 0.12
z = height(x, y)
cone('Station plinth', (x, y, z + 0.07), 0.52, 0.45, 0.18, cols[2], 32)
for (i, m) in enumerate([cream, cream, rust, cream, rust]):
cone('Tapered lighthouse drum', (x, y, z + 0.29 + 0.245 * i), 0.37 - i * 0.025, 0.346 - i * 0.025, 0.248, m, 36)
yield
cyl('Lantern deck', (x, y, z + 1.43), 0.33, 0.08, black)
cyl('Fresnel lantern', (x, y, z + 1.61), 0.209, 0.3, lamp)
for i in range(8):
a = tau * i / 8
rod('Lantern mullion', (x + 0.223 * cos(a), y + 0.223 * sin(a), z + 1.47), (x + 0.223 * cos(a), y + 0.223 * sin(a), z + 1.78), 0.015, black)
cone('Lantern roof', (x, y, z + 1.86), 0.33, 0.055, 0.22, rust, 16)
for j in range(15):
xx = x - 0.18 - j * 0.108
yy = y - 0.34 - 0.36 * sin(j * 0.19)
bx('Coastal steps', (xx, yy, height(xx, yy) + 0.029), (0.103, 0.23, 0.056), cream, 0.012)
yield
course_key = 'SmartTools lesson / archipelago'
session = bpy.app.driver_namespace
current = session.get(course_key)
if not current or current[0] != bpy.context.scene:
for required in ['smart_camlight_suite', 'smart_geometry_suite', 'smart_shader_suite']:
product_module(required)
scene = bpy.data.scenes.new('Study / archipelago')
bpy.context.window.scene = scene
current = [scene, drawing(scene), 0]
session[course_key] = current
if current[2] < 3:
next(current[1])
current[2] += 1
current[0]['Lesson step'] = current[2]
bpy.context.view_layer.update()
Click ▶ Run Script at the top of the Text Editor once per step, three times in total. The first click opens a separate study scene. Between clicks, hover over the 3D Viewport and press Home to frame the objects.

Choose View → Cameras → Active Camera and compare the framing with the image above. Choose Render → Render Image (F12), then Image → Save As in the render window to save a PNG. Save the .blend file to keep the editable scene.
Select Coastal steps and press Numpad Period to inspect the coast. The steps follow the local terrain height down from the lighthouse toward the water.
If you close the file between steps, start the lesson again in a new file.
Terrace the terrain, shape the shoreline, then place the tower and trees above sea level.
The terrain starts with 72 segments and seed 43. Its terraces are shaped to the coastline. Steep faces receive rock, flatter faces grass; the lighthouse and trees are placed separately.
Create Terrain with Relief Using a Single ButtonTerraced a generated terrain mesh, then lowered its perimeter into the sea.
With the terrain seed fixed, raising terracing from 0 to 0.7 cuts distinct shelves into the slope. The finished scene uses terraced ground for the lighthouse, steps and vegetation.
Square terrain with relief is created as a single mesh in empty space. With the same "Random Seed" and the same settings, you get the same shape no matter how many times you create it.
View the captured exampleClear-coated red enamel defines the bands and lantern roof.
SmartTools Shader walkthrough ↗All controls and documentationA target-tracking camera keeps the process and final views aligned.
SmartTools CamLight walkthrough ↗All controls and documentationSales open January 1, 2027. One-time prices in USD. Local taxes may apply.
How do you build a readable coastal landmark?
Total for these individual tools $62
Included tools used here
SmartTools Geometry
Tools used here outside this bundle
SmartTools Shader · SmartTools CamLight
Bundle plus the listed tools outside it: $132
For just the listed tools, individual purchases cost $70 less.
Also in the bundle
SmartTools Modeling · SmartTools UV