View Full Version : extracting depth information to use as a bump map
maxnix 02-04-2006, 10:38 PM I have been evaluating at painter to augment my texture creation that I do in photoshop. The impasto brush could be great for creating displacement, and bump maps. I need a way to extract the depth information that impasto uses. The information exists within the .riff file we just need to be able to export it as a greyscale image. This would be be a valuable tool for 3d texture artists.
Thanks
Max
|
|
Hi,
The impasto export issue has been brought up before, but I don't think anyone has offered a solution yet. I had a quick look at an uncompressed RIFF file and indeed, the impasto data is there just waiting to be extracted. I wrote a small python script that reads the data and exports it as a 32-bit PNG:
import PIL
import PIL.Image
import PIL.ImageOps
import struct
file = open ("impasto.riff", "rb")
file.seek(4)
h = struct.unpack("h",file.read(2))[0]
w = struct.unpack("h",file.read(2))[0]
print h, w
file.seek (0x170 + w * h * 4) # Location of impasto buffer
buffer = file.read (w * h * 4) # Impasto channel, 32-bit integer
image = PIL.Image.frombuffer ("I", (w, h), buffer)
image = PIL.ImageOps.flip (image)
image.save ("bump.png", "png", mode="I")
I have only run it on a Mac, so I can't tell you if it will work on a x86 based system.
To run it you need Python (http://www.python.org) and PIL (http://www.pythonware.com/products/pil/).
Have fun!
Alternatively, you can simply go to Effects --> Fill and fill the image with 50% grey. This does not affect the impasto effect which will remain but on a grey background.
In the Canvas menu you can also control the look of the impasto effect by selecting the Surface Lighting option.
Check out this thread (http://forums.cgsociety.org/showthread.php?t=213256). The only way to get the bump map is to yank it from a riff file.
Yes, I agree - if you need the actual depth coordinates that seems to be the only solution
DigArts
02-09-2006, 05:49 PM
I seem to recall Fractal saying the sphere lighting adjuster on the Add Surface Texture filter window was driven by or is z axis data. The point being, Painter has always had the ability to use height data via this filter. Moreover, isn't Painter using grays to build height data when you choose Capture Paper Texture?
You might find some answers in the old Painter 3D, or Detailer as they employed an early version of impasto as well as filter texturing. Presumably, they also had the means to export height data given the 3D designation. If you find an effective way to export height data, it would find useful applications in non impasto, captured brushes like painting architectural surfaces (http://www.gardenhose.com/concrete.mv).
I seem to recall some maneuvers for filling masks or some such that provided similar height saving opportunities. I just don't remember anymore and those that may have applied may no longer be a part of Painter. I simply don't work with 3D that much, but someone who does might want to check out mask data as well.
Given Painter's ablility to paint truly seamless brush strokes, not to mention the ability to do that on layers (if painfully slow) gives it unique advantages. If I'm not mistaken Painter 3D had a UV Mapper type feature as well. Just that feature and height export alone would be nice additions to Painter X.
Dennis @ DigArts
http://www.gardenhose.com (http://www.gardenhose.com/)
CGTalk Moderation
02-09-2006, 05:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.