[Bf-committers] Bicubic filtering for bump maps, patch + discussion

Morten Mikkelsen mikkelsen7 at gmail.com
Thu Oct 27 00:09:28 CEST 2011

It should be mentioned that two variants are 3) are possible.
One is to simply convert the color image to grayscale during uploads to the
The other is to actually support single channel image painting in blender
and then only support
the bicubic for such bump maps.
Though I would be thrilled to see single channel images supported in blender
for painting
I actually still like the idea of converting the bump map during upload to
because it makes it more efficient all around whether bicubic is in use or
It consumes less memory and makes it more feasible for people to use
the new (2.61) 16 bits per height in glsl when the bump map is a float

However, I have no idea if this is possible or not since it requires knowing
at that point in the code that
the texture to be uploaded is used by a material with bump and it also
requires knowledge on whether or not the same texture
will be used for anything color related.

Another option is of course to define it such that blender always does bump
using red channel only but I am guessing
I won't win any popularity contests with this suggestion? :)

Anyway, the difference in quality is very significant so I'm hoping we can
work this in somehow.
Several artists were bugged by the lack of quality during close-up when
painting bump maps.

2011/10/26 Αντώνης Ρυακιωτάκης <kalast at gmail.com>

> Hi everyone, there has been some work by Morten Mikkelsen for
> supporting bicubic filtering for bump maps. I have helped adapting the
> code to glsl and the result can be seen here:
> old:  http://www.pasteall.org/pic/19660
> new: http://www.pasteall.org/pic/19659
> The patch is here:
> http://www.pasteall.org/25833/diff
> Notes:
> This patch substitutes the "Best Quality" setting on capable GPUs with
> bicubic filtering. It may be preferable to make an extra setting
> altogether for this?
> The functionality relies on GLSL 1.3 and uses the textureGather
> function to quickly get samples from nearby texels. Getting the
> samples normally would require 16 instead of 4 texture samples.
> However only the red component is taken. This implies that for correct
> behaviour the rgb scannels need to be identical. Bump maps are usually
> monochrome anyway but it is possible to use a colour image as a bump
> map with in trunk functionality. After some discussion with Morten we
> thought that there are some ways this could be done(with increasing
> difficulty IMO):
> 1) Leave it up to the artist to enforce that he uses only black/white
> images
> 2) Use 16 samples and make this an extra setting for good systems
> 3) Make 1-channel images and a luminance upload path for 1-channel
> images. "Best Quality" bump maps only work with one-channel images
> Thoughts?
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list