Normal Map - c++ 3D

Normal Map

Also named bump map

And parallax map

Light

The 3D scene world must have light.

Enable Lighting

The target object must enable lighting.

Material Type Normal Map

Set material type of object to normal map type.

Two Layers of Textures

Tex0 is used as solid texture.

Tex1 is used as normal map texture.

Vertex Texture Coordinates

Upgrade texture UV to support normal map.

Texture image bump

Upgrade loaded texture image to let it bump.

Planar Mapping

Use planar mapping to make surface smooth.

Surface Param

Adjust surface param floating bits.


auto * object = new d_3d::normal_map_object;
object->set_material_type(d_3d::normal_map_type);
object->set_texture(0, tex0_image);
tex1_image->make_normal_mapping();
object->set_texture(1, tex1_image);
delete object;
object = nullptr;

Tue Aug 12 12:01:44 AM UTC 2025