September 2018
Intermediate to advanced
472 pages
15h 36m
English
To add the PCF technique to the shadow mapping algorithm, use the following steps:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR);
subroutine (RenderPassType) void shadeWithShadow() { vec3 ambient = vec3(0.2); vec3 diffSpec = diffAndSpec(); // The sum of the comparisons with nearby texels float sum = 0; // Sum contributions from texels around ShadowCoord sum += textureProjOffset(ShadowMap, ShadowCoord, ...Read now
Unlock full access