Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/208426375378518016
added 164 characters in body
Source Link
Grieverheart
  • 1.2k
  • 3
  • 15
  • 26

Here is a comparison with and without shadow mapping of a close-up of the crate. The self-shadowing is more visible.

Here is a comparison with and without shadow mapping of a close-up of the crate. The self-shadowing is more visible.

added 74 characters in body
Source Link
Grieverheart
  • 1.2k
  • 3
  • 15
  • 26

The other problem is that pixels outside the Light's view frustum get shaded. The only object that is supposed to be able to cast shadows is the crate. I guess I should pick more appropriate projection and view matrices, but I'm not sure how to do that. What are some common practices, should I pick an orthographic projection?

The other problem is that pixels outside the Light's view frustum get shaded. I guess I should pick more appropriate projection and view matrices, but I'm not sure how to do that. What are some common practices, should I pick an orthographic projection?

The other problem is that pixels outside the Light's view frustum get shaded. The only object that is supposed to be able to cast shadows is the crate. I guess I should pick more appropriate projection and view matrices, but I'm not sure how to do that. What are some common practices, should I pick an orthographic projection?

Explained problems in more detail
Source Link
Grieverheart
  • 1.2k
  • 3
  • 15
  • 26

One of the problems is self shadowing as you can see in the picture, the crate has its own shadow cast on itself. What I have tried is enabling polygon offset (i.e. glEnable(POLYGON_OFFSET_FILL), glPolygonOffset(GLfloat, GLfloat) ) but it didn't change much. As you see in the fragment shader, I have anput a static offset value of 0.001 but I have to change the value depending on the distance of the light to get more desirable effects , which not very handy. I also tried using front face culling when I render to the framebuffer, that didn't change much too.

One of the problems is self shadowing as you can see in the picture, the crate has its own shadow cast on itself. What I have tried is enabling polygon offset but it didn't change much. As you see in the fragment shader, I have an offset value of 0.001 but I have to change the value depending on the distance of the light to get more desirable effects , which not very handy.

One of the problems is self shadowing as you can see in the picture, the crate has its own shadow cast on itself. What I have tried is enabling polygon offset (i.e. glEnable(POLYGON_OFFSET_FILL), glPolygonOffset(GLfloat, GLfloat) ) but it didn't change much. As you see in the fragment shader, I have put a static offset value of 0.001 but I have to change the value depending on the distance of the light to get more desirable effects , which not very handy. I also tried using front face culling when I render to the framebuffer, that didn't change much too.

added 406 characters in body
Source Link
Grieverheart
  • 1.2k
  • 3
  • 15
  • 26
Loading
Source Link
Grieverheart
  • 1.2k
  • 3
  • 15
  • 26
Loading