I have not figured out how to blend the rendered object with a bitmap light source, but I need this blended image to activate my volumetric lighting pixel shader. However, I realized that the calculation inside the post-process volumetric lighting shader is completely on screen space (which makes it super fast!). So I came up a way to test my volumetric lighting shader without the blended image.
It's pretty simple: I just manually drew solid black shapes on top of a light source image. I also made the light source image myself: I drew a circle with a gradient from yellow to black in Photoshop on top of a black layer; merged the two layers and applied a Gaussian filter to smooth it out. Then I load I just loaded the light source image with hand-drawn black solid shapes as a regular texture image and feed it into the volumetric lighting shader. It does generate volumetric lighting effects on this image (yay!). I tuned the constant parameters (EXPOSURE, DECAY, WEIGHT, NUM_OF_SAMPLES) to achieve better effects. See the attached pic for some results I got. I also got some crazy results when the light source itself contains many black streaks.
With EXPOSURE = 0.3, DECAY = 0.9, DENSITY = 5.3, WEIGHT = 0.7, and NUM_OF_SAMPLES = 250:




No comments:
Post a Comment