tip : improve bump and displacement renders by using 16-bit versions of your maps

mCasualmCasual Posts: 4,607

most images use 8 bits per color channel, which gives us 256 grayscale levels.
here (fig1) is a graymap with 256 levels of gray named yuppp8.png
when applied to the Displacement channel in daz studio and software-rendered, we get fig 2.
by converting this gray map to a 16-bit tiff file and blurring it a little we can get rid of the staircases. ( fig 3 )
it's not as good a solution as having a native 16-bit map but i think it helps

the freeware way is :
download and install imagemagick from www.imagemagick.org

what you want to download is called the "binaries" not the "sources"

versions that do support 16 bit images are labeled "Q16"

write a batch file like this using a text editor like notepad or wordpad


c:\imagemagick\convert yuppp8.png -depth 16 -blur 16x16 yuppp16blurred.tif

save it as "convertme.bat"

run/execute it by double-left-clicking on "convertme.bat" ( in Windows Explorer )

it converts the 8-bit png to 16 bit and blurs it then saves it as yuppp16blurred.tif

note that the way "convertme.bat" is written, it takes for granted that you installed imagemagick in your c:\imagemagick\ folder

and it takes for granted that yuppp8.png is in the same folder as "convertme.bat"

note: when i tried with a source image being a JPEG file, imagemagick refused to do it

so i converted my jpg into a png image using paintshop

but this would probably work too:


c:\imagemagick\convert yuppp8.jpg yuppp8.png
c:\imagemagick\convert yuppp8.png -depth 16 -blur 16x16 yuppp16blurred.tif

---
it works in many modern 3D softwares

in Blender-Cycles this allowed me to get Fig 5 instead of Fig 4

annoy2.jpg
1920 x 1080 - 214K
annoy.jpg
1920 x 1080 - 599K
bumpres2.jpg
600 x 600 - 62K
bumpres1.jpg
600 x 600 - 94K
bump8.png
512 x 512 - 22K
Post edited by mCasual on

Comments

  • SzarkSzark Posts: 10,634
    edited December 1969

    LOL I was waiting fo the rest to appear before commenting...nice tip thank you very much for shar................ :P

  • mCasualmCasual Posts: 4,607
    edited September 2013

    3x3 blur instead of 16x16

    i'm starting to think that it's the JPEG compression that produces the initial staircases

    ...nope, i did a test, loaded the jpg in a paint program, blurred it, saved it as an uncompressed 8 bit TGA

    and the resulting render had staircases/artefacts ... so the 16-bit conversion is necessary

    annoy3.jpg
    1920 x 1080 - 277K
    Post edited by mCasual on
  • V3DigitimesV3Digitimes Posts: 3,150
    edited December 1969

    Wow! Thanks for this tip!

  • mCasualmCasual Posts: 4,607
    edited September 2013

    here i used a Daz PointLight to render something that i can use as a displacement map

    the 16-bit version ( smooth ) was blurred with a 3x3 filter

    c:\imagemagick\convert bliprender.tiff -depth 16 -blur 3x3 bliprender16bit.tif 

    fig 5 - with tiling, there's artifacts that become apparent , they'd probably me solved be reducing the Shading Rate
    part of the problem may be the use of refractive glass

    acoustifloor.jpg
    1920 x 1080 - 862K
    topo.jpg
    1280 x 720 - 134K
    combocombo.jpg
    546 x 900 - 69K
    dot.png
    800 x 450 - 246K
    bumpyride.jpg
    1920 x 1080 - 379K
    Post edited by mCasual on
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    Can't you do the conversion and blurring with tdlmake and get same results?

  • SylvanSylvan Posts: 2,711
    edited October 2013

    How does this workout in Luxus?
    I know that Reality has some problems with the bump and displacement maps within DAZ (they have to be dialed to 0 and later changed withing Reality itself).
    Will it still work out?

    Post edited by Sylvan on
  • mCasualmCasual Posts: 4,607
    edited December 1969

    Can't you do the conversion and blurring with tdlmake and get same results?

    probably but you'll have to figure how to ask tdlmake to do it
    http://www.3delight.com/en/uploads/docs/3delight/3delight_12.html

  • mCasualmCasual Posts: 4,607
    edited December 1969

    Estroyer said:
    How does this workout in Luxus?
    I know that Reality has some problems with the bump and displacement maps within DAZ (they have to be dialed to 0 and later changed withing Reality itself).
    Will it still work out?

    i dont really know much about luxus, reality and luxRender

    but i saw a few minutes ago luxRender can juggle with EXR images so it must not be afraid of 16 bit per channel images

    if luxus refuses to play with 16-bit tif images you could try png or tga as the output format of the convert&blur; batch file

    also note that in my example i use a 16x16 blur filter which is way too soft except for huge images, so you could use 4x4

  • SzarkSzark Posts: 10,634
    edited December 1969

    well thanks to you I am now making all Bump and Displacement maps in 16 bit Grayscale as Tiff's. Nice and smooth results now. Thank you so much again for this tip Casual.

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited December 1969

    Like many of the best ideas this one's simple, obvious (once it's been pointed out) and makes one think "now why hadn't I thought of that before?" Many thanks Casual!

  • MarshianMarshian Posts: 1,462
    edited December 2013

    This post helped a lot! However I'd like to add that even with displacement images at 16bit / grayscale artifacts may render if the image has extreme contrast (lots of black and very light areas). I blurred the images a bit and toned down the contrast to more of a medium-range grayscale and the artifacts disappeared.

    It's interesting that turning progressive render off and on affects displacement.
    It's interesting that I can go to high numbers for maximum displacement but dropping the minimum to low (below -4) starts to show artifacts.
    It's related to reflections somehow, that I'm using Ubersurface, and that my terrain was exported from Bryce.

    Post edited by Marshian on
Sign In or Register to comment.