Hey,
in order to compute light intensity for a pixel, I need to sum per-pixel attenuation along a ray to a buffer. The ray is parallel to the x-axis, so I have to sum values along the x-axis:
eg. 0112011 would become: 0124456 (number is sum of all previous numbers plus itself)
This is a rather complex operation, depending on length of ray (width of texture) and number of rays (height).
I thought a solution would be to draw the texture additive multiple times, shifting it to the right one pixel each time:
0112011
+ 011201
+ 01120
+ 0112
+ 011
+ 01
+ 0
_________
0124456
This works, but is computation expensive as well. Also, there are only 255 values which yields chunky results. I can't encapsulate numbers to 3-digit base 256 colors because additive blending would break this (it just adds per channel obviously).
Please ask if I have not described the problem well. I hope someone can help me!
Thanks, Phil