Getting sampler2DShadow to work
-
motorfreak
- Posts: 21
- Joined: Thu Feb 20, 2014 7:39 pm
Getting sampler2DShadow to work
Does anyone have a working example of how to set up textures so that they work as sampler2DShadow?
Re: Getting sampler2DShadow to work
Just use sampler2D. Sampler2DShadow is deprecated solution.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
-
motorfreak
- Posts: 21
- Joined: Thu Feb 20, 2014 7:39 pm
Re: Getting sampler2DShadow to work
That should not have anything to do with it. It should work anyway. I have added this to OpenGLTexture:Nadro wrote:Just use sampler2D. Sampler2DShadow is deprecated solution.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
then I use sampler2Dshadow and query it with shadow2D(shadowTex, vec3(xy, z));
I was able to make it work just fine if I do comparison in shader (using texture2D instead. But when I switch to shadow it does not work anymore. So I know that: there is nothing wrong with my texture coordinates, there is nothing wrong with the depth value passed in to shadow2D. So it must be something wrong with how the framebuffer texture is created.
is there an example somewhere on how to do soft whadows with irrlicht and glsl?