Representative Image Color

I have thought about this for years, in a very low-priority thread in my head.

There are many situations where it could be useful. In this particular instance, we are making a rotoscoping application with Nuclear, where we draw polygons over a video, to create animations for Continue reading

Multipass Rendering #2

3dengfxAfter thinking about it for a while, there is also another aspect about multipass lighting I always feared, and its really trivial to handle, just like fog.

Transparent objects are rendered the same way as fogged objects: the final shaded pixel is linearly interpolated with a color, just like fog, but this time the color comes from the destination pixel. If you do the math,or if you take a look at my previews post, it becomes clear that transparent objects can easily be multiopass lit. Both techniques can also be combined as well.

Continue reading

Handling fog with multipass lighting

3968508808_68c7ea6947_bThe thought of fog problems with multipass lighting has prevented me from using multipass in my renderers for too long. Today I decided to stop and think about it for a minute, and the solution is very simple!

Fog is implemented as a linear interpolation between the shaded color of the pixel and the fog color, using a fog factor. In my case the fog factor is calculated like this:

float fog_factor = exp2(-abs(view_dist * fog density)); Continue reading