Lighting

Some of the available materials will take the lighting into account. Qt 3D allows you to add different types of lights to the scene and configure them. You can do that by adding a new Entity to the scene and attaching a DirectionalLight, PointLight, or SpotLight component to it. Each of these components has the color property that allows you to configure the color of the light and the intensity property that allows you to choose how bright the light is. The rest of the properties are specific to the light type.

Directional light (also called "distant light" or "sunlight") casts parallel rays in the direction defined by the worldDirection property of the DirectionalLight type. Position and rotation of the entity have no influence ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.