Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn OpenGL

You're reading from   Learn OpenGL Beginner's guide to 3D rendering and game development with OpenGL and C++

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789340365
Length 208 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Frahaan Hussain Frahaan Hussain
Author Profile Icon Frahaan Hussain
Frahaan Hussain
Arrow right icon
View More author details
Toc

Lighting up objects

In this section, we'll be looking at basics of lighting because so far, if you look at the results from our previous section, which just discussed colors, what we've got is the cube and the light source. At the moment, the entire color in the cube output just looks uniform. It almost doesn't look like a cube, a six-sided shape figure, and the lighting doesn't look very realistic too. Because realistically, in our example, the light source doesn't emit light onto our cube and there is no effect of light and shadow on the cube. So, in this section we'll discuss the basics of lighting and effect on the cube. We'll focus on improving the lighting system so we can have a more realistic effect.

So, let's get started. As usual, we'll begin making modifications to our shader files.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime