@GearGOD every object that should cast a shadow is drawn black in front of a white background. A rendertarget captures this black-white image. Another rendertarget captures the colored scene. These two images are then processed in a pixel shader. The black and white image is blurred from a specified position (radial blur from mouse coordinates). Multiplying the blurred image with the colored scene results in a shadowed scene. Finally I played around with contrast and brightness..
@marcelkade Ah. That's very expensive on a per-light basis isn't it. I was doing something similar but by storing many copies of the geometry and expanding shadow volumes in the vertex shader from light source + a small offset per volume.
How does it work?
GearGOD 10 months ago
@GearGOD every object that should cast a shadow is drawn black in front of a white background. A rendertarget captures this black-white image. Another rendertarget captures the colored scene. These two images are then processed in a pixel shader. The black and white image is blurred from a specified position (radial blur from mouse coordinates). Multiplying the blurred image with the colored scene results in a shadowed scene. Finally I played around with contrast and brightness..
marcelkade 10 months ago
@marcelkade Ah. That's very expensive on a per-light basis isn't it. I was doing something similar but by storing many copies of the geometry and expanding shadow volumes in the vertex shader from light source + a small offset per volume.
GearGOD 10 months ago
@GearGOD yes, it's not a very good method if there are several light sources but it was just a test...
marcelkade 10 months ago