May 2017
Intermediate to advanced
982 pages
22h 42m
English
The previous recipe handled a directional light source but without attenuation. The relevant changes to enable per-fragment point light with attenuation will be given in this recipe. We start by implementing per-fragment point light, as in the Implementing per-vertex and per-fragment point lighting recipe.
The code for this recipe is contained in the Chapter4/PointLight folder.
Implementing per-fragment point light is demonstrated by following these steps:
#version 330 core layout(location=0) in vec3 vVertex; layout(location=1) in vec3 vNormal; uniform mat4 MVP; uniform mat4 MV; uniform mat3 N; ...
Read now
Unlock full access