Files
zoom/NOTES

36 lines
1.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Missing Member Declarations
You call shadowFBO, shadowMap, depthShader, and lightSpaceMatrix in Initialize() but never declared them in Engine.h.
Solution: add these as GLuint shadowFBO; GLuint shadowMap; Shader depthShader; glm::mat4 lightSpaceMatrix; and static constexpr int SHADOW_RES = 2048; to the Engine class.
Local vs. Class Constant
You define a local const unsigned int SHADOW_RES = 2048; inside Initialize(), but elsewhere refer to SHADOW_RES as a classwide constant.
Solution: remove the local definition and use the class member Engine::SHADOW_RES.
Undefined Shader Source and Wrapper
You call depthShader = Shader(depthVertexSrc, depthFragmentSrc); yet never provided the depthVertexSrc or depthFragmentSrc strings or a Shader wrapper class.
Solution: supply the depthonly shader source code and ensure a Shader class with a .use() and .setMat4() interface is implemented.
Viewport and Buffer Binding Order
In Initialize(), you configure the FBO before completing the context and shader setup. Make sure the GL context is fully initialized (GLAD, GLFW) before creating textures and framebuffers.
Typo in Texture Format
You used glTexImage2D(..., GL_DEPTH_COMPONENT, ...) without specifying the internal format as GL_DEPTH_COMPONENT24. Some drivers require the full form.
Solution: use glTexImage2D(..., GL_DEPTH_COMPONENT24, ...) for consistent behavior.
Missing Light Position Initialization
You reference lightPos when computing lightSpaceMatrix but never initialized it.
Solution: define a glm::vec3 lightPos member, set it before calculating lightSpaceMatrix.
Addressing these five areas will clear up the undeclaredidentifier errors and establish a working shadowmapping pipeline.