I have recently implemented cascaded shadow maps and make it stable by following this post. Now everything works, except that when I move directional light to the top mid of the world, the shadow suddenly turns all dark. With some debugging I find that the light view matrix is causing the problem. This is how ..
For cascaded shadow mapping I’m trying to use a GL_TEXTURE_2D_ARRAY for the individual shadow maps. However following tutorials found online and even looking up things in a textbook I can’t seem to create a working framebuffer, as it always errors with GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT. The code: glGenFramebuffers(1, &m_DepthMap.m_FrameBuffer); glGenTextures(1, &m_DepthMap.m_DepthTexture); glBindTexture(GL_TEXTURE_2D_ARRAY, m_DepthMap.m_DepthTexture); glTexImage3D( GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH_COMPONENT32F, Renderer::m_ShadowMapResolution, ..
I am implementing a dynamic illumination system in OpenGL and using Uniform Buffer Objects (UBOs). This worked great… until I wanted to enable shadow mapping, because I cannot define samplers in the structs describing my light sources and then upload them using UBOs. Apparently samplers don’t work with structs inside UBOs. Is there any way ..
I want to create a simple game engine with OpenGL using C++. I did all the lighting and stuff, but i wasn’t able to create shadows for my objects. I want to know what is wrong with my code or at least have an idea about what should i do. I checked https://learnopengl.com/ and i ..
My shadows are working but not the way I want. We should be able to transform world positions into camera points of view before projecting them to the light’s POV. This way we can control shadows according to their distance to the camera. My matrices should be valid because everything works in the first example. ..
I’m trying to implement shadow maps into my 3D world I created with openGL. I want to be able to move around the map and the shadow to follow as I move, so I needed a light Projection matrix that take into account my world view frustrum. glm::mat4 lightProjectionMatrix = glm::ortho<float>(camera->_width * -0.5f, camera->_width * ..
So I’ve been trying to re-implement shadow mapping in my engine using directional lights, but I have to throw shade on my progress so far (see what I did there?). I had it working in a previous commit a while back but refactored my engine and I’m trying to redo some of the shadow mapping. ..
Problem Description I’m following (loosely) along the point light shadow map tutorial on LearnOpenGL to render a depth cubemap with a geometry shader in one pass. However I haven’t been successful in doing so. When I render the scene without shadows I get this image. However when I tried to render it with depth map ..