top of page
Szukaj
  • marcindziedzic

Shadow mapping - point lights

Continuation of implementing shadow mapping - generating shadows casted by point lights. The idea is the same as in case of generating shadows from directional lights, but this time we have specified position of light source. From that point (light source), we are generating cube map of depths (not 2D texture like in case of directional lights). After that, things are very similar and generating shadows is based on comparing actual fragment's depth with the depth "seen" by light source. Again, we need to apply bias, antialiasing and pick perfect parameters to make the shadows look tolerably.


In view of framework itself, implementing this type of shadow mapping meant adding rendering to cube map. It could be of course done by rendering scene six times to six standard 2D textures, but there is much better way to do it. We can attach cube map to framebuffer and use geometry shader to render every triangle six times, each time on other side of cube map (gl_Layer built in variable in geometry shader). We have then much less draw calls.



17 wyświetleń0 komentarzy

Ostatnie posty

Zobacz wszystkie
bottom of page