Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access