An elaboration on Minimal D3D11 pt2, adding shadowmapping and incorporating various improvements and alternative approaches to the rendering setup, such as manual vertex fetching, samplerless texture lookup, null shader depth map rendering and procedurally generated texture and instance data. As before, this is intended to be an uncluttered Direct3D 11 setup & basic rendering primer / API familiarizer, in the form of a complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion. No modern C++ / OOP / obscuring cruft. View on YouTube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sample textures | |
vec4 albedo_tex = texture2D(texture, texcoord); | |
vec4 normal_tex = texture2D(normals, texcoord); | |
vec4 specular_tex = texture2D(specular, texcoord); | |
//Gamma correction - Optional if you're not doing gamma correct lighting | |
albedo_tex.xyz = pow(albedo_tex.xyz, vec3(2.2)); | |
//Normals | |
vec3 normal; |