I recently started to create a shadow mapping system in OpenTK.I ran into a problem: The depthtexture is always completly white -> no depth. Even if the color from the shader is changed (I know it shouldn't effect anything.).Here is my shadow mapper class:class ShadowMapper{    static int frameBuffer = 0;    static int depthTexture;    static readonly int shadowMapResolution = 1024;    static ShadowShader shader;    public static void Init()    {        shader = new ShadowShader();        frameBuffer = GL.GenFramebuffer();        GL.BindFramebuffer(FramebufferTarget.Framebuffer, frameBuffer);        depthTexture = GL.GenTexture();        GL.BindTexture(TextureTarget.Texture2D, depthTexture);        GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.DepthComponent16, shadowMapResolution, shadowMapResolution, 0, PixelFormat.DepthComponent, PixelType.Float, (IntPtr)null);        GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);        GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);        GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.ClampToEdge);        GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.ClampToEdge);        GL.FramebufferTexture(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, depthTexture, 0);        GL.DrawBuffer(DrawBufferMode.None);        Console.WriteLine(GL.CheckFramebufferStatus(FramebufferTarget.Framebuffer) == FramebufferErrorCode.FramebufferComplete);        GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);    }    public static void Render(Dictionary<TexturedModel, List<Entity>> entities, Light sun)    {        Matrix4 depthProjectionMatrix = Matrix4.CreateOrthographic(-10, 10, -10, 10);        Matrix4 depthViewMatrix = Matrix4.LookAt(sun.Position, sun.ToLookPosition, new Vector3(0, 1, 0));        GL.BindTexture(TextureTarget.Texture2D, 0);        GL.BindFramebuffer(FramebufferTarget.Framebuffer, frameBuffer);        GL.Viewport(0, 0, shadowMapResolution, shadowMapResolution);        GL.Enable(EnableCap.DepthTest);        GL.Clear(ClearBufferMask.DepthBufferBit);        shader.Start();        foreach (TexturedModel model in entities.Keys)        {            RawModel rawModel = model.Model;            GL.BindVertexArray(rawModel.VaoID);            GL.EnableVertexAttribArray(0);            foreach (Entity entity in entities[model])            {                Matrix4 depthModelMatrix = Maths.CreateTransformationMatrix(entity.Position, entity.RotationX, entity.RotationY, entity.RotationZ, entity.Scale);                Matrix4 depthMVP = depthProjectionMatrix * depthViewMatrix * depthModelMatrix;                shader.LoadMvpMatrix(depthMVP);                GL.DrawElements(PrimitiveType.Triangles, rawModel.VertexCount, DrawElementsType.UnsignedInt, 0);            }        }        GL.DisableVertexAttribArray(0);        GL.BindVertexArray(0);        GL.Disable(EnableCap.DepthTest);        shader.Stop();        GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);        GL.Viewport(0, 0, Window.Instance.Width, Window.Instance.Height);    }    public static int DepthTexture    {        get        {            return depthTexture;        }    }}And my vertex/fragment shaders: Vertex Shader: #version 330 core// Input vertex data, different for all executions of this shader.in vec3 vertexPosition_modelspace;// Values that stay constant for the whole mesh.uniform mat4 depthMVP;void main(){gl_Position =  depthMVP * vec4(vertexPosition_modelspace,1);}Fragment Shader: #version 330 core // Ouput data out float fragmentdepth; out vec4 out_colour; void main(){ // Not really needed, OpenGL does it anyway fragmentdepth = gl_FragCoord.z; out_colour = vec4(1.0, 0.0, 0.0, 0.0); }Any help?
Shadow Mapping Errors
opengl;shader;shadow