![]() |
|
|
|
||
![]() The Alpha
Channel &
Particle Foliage tutorial (making grass images for 3D
renderings)
|
[more tutorials] |
|
|
||
When
doing 3D rendering, often times you want to embellish the 3D scene with
foliage effects such as grass, shrubbery and trees. You can
either find and use 3D tree generation software or plugins. Or you
might want to use images of shrubbery, and texture-map them onto a
simple rectangular shape in the 3D scene at the right orientation for
proper viewing by the camera. This is particularly the case for
realtime 3D games and also commonly used in rendering of large
architectural scenes. The question then is: where to find great,
realistic looking grass and tree images complete with alpha channel? PD Pro has a fast fractal particle brush system called Optipustics. It is a great tool to quickly create all sorts of grass, weeds, bushes and other foliage effects. Even hair and waterfall as well as fiery explosions and smoke effects can be created with it. In this tutorial we experiment with some of the tools used in this context of making images of shrubbery for 3D rendering use, including the creation of an alpha channel image. |
![]() |
|
We begin
with a blank document (image buffer) in Dogwaffle. |
||
Then open the
Optipustics
panel. It's available from the Window menu as well as a keyboard
shortcut: 'i' (easy to remember: 'i' as in 'incredible' ) When the Optipustics control panel appears, click the checkbox at the top to enable it. |
![]() |
|
There are many parameters
involved in drawing with these particles. They can react to gravity,
they can have mass, they can split at various angles, etc... At the bottom of the Optipustics panel, select the Settings for a choice of presets. |
![]() |
|
There are a bunch of presets which come with the product. There are additional presets you may have created yourself, or gotten from the freebies area. Let's select the SprayBranches. It was included with the free patch v2.1 for Project Dogwaffle v2. See the collection of presets here. |
![]() |
|
After clicking on the
SprayBranches item, the many parameters of the Optipustics panel are
loaded with the new settings. Using PD pro, one item is however optional, and that's whether the color gradient also should be replaced with the one saved in the selected Optipustics file. Click OK to use it. |
![]() |
|
You can now liberally drag the
mouse around to paint with this particle brush. click the image to view a
Flash animation>>> |
![]() |
|
Here's an example of a piece of
shrubbery we've quickly created in this manner. Click the image to view the full size saved as Jpeg>>>
We also saved it as a Targa image here (zipped, 400kb) |
![]() |
|
Now that we have this image
painted in the Main buffer, let's first save (store) a copy of it,
using the menu: Buffer > Store
Buffer...
That way we can easily reload the image into the Main (or Swap) buffer if needed by clicking the Functions button and selecting "Replace" or other options to combine the stored image with the buffer's image. |
![]() |
|
The next step is to create the
Alpha channel. We can simply copy the image from the Main buffer to the
Swap buffer, and from there to the Alpha channel. These options are in
the Buffer menu of course, and they also have their keyboard shortcuts. Buffer> Copy to Swap Buffer> Copy Swap Buffer to Alpha |
![]() |
|
Now that the Alpha channel is
there, we can take a look at it. Select Alpha > Store Alpha... |
![]() |
|
The Alpha buffer is viewed as a
greyscale. In this example PD Pro used the luminosity of the pixels and
matched them to an 8-bit greyscale value. We might want to turn this
into a simpler alpha, where pixels are only either fully transparent or
fully opaque. This can be done with the Threshold filter. To use it, we can start from the original colored image in the Main buffer or copy the Alpha buffer's image back to where we can process it with the filter, i.e. the Main or Swap buffer. |
![]() |
|
We can copy that Alpha buffer
back to the Swap buffer. Use menu: Buffer > Copy Alpha to Swap and then press 'j' to jump to the Swap buffer. It will be a Greyscale there. Click the image for
larger view>>> |
||
Now we're ready to use the
threshold filter on the image. (in fact we could have started from the
colored original image too). Select menu: Filter > Adjust > Threshold |
![]() |
|
You will see a slider in the filter's dialog box. Use it to select the desired grey value where the transition from white to black is happening. Click this image to
view an animation>>> |
![]() |
|
Once you have the alpha channel
set the way you want it, you can save it in different ways. Some 3D
programs can use a separate image file for the transparancy or alpha
channel. In such case you might save the colors in a 24-bit Targa image
file and the Alpha channel (perhaps from the Swap buffer) in a
greyscale 8-bit Targa image file. Other 3D programs will work with single image files of 32-bit depth, where the colors and alpha is present at the same time. You can save either ways in PD Pro. The default format used by Project Dogwaffle and PD Pro is indeed the Targa format (*.tga files), suitable for various color depths. Even the free version 1.2 supports this format. |
![]() |
|
Here's another final look with
the
greyscale image inverted. Your 3D application should normally be able
to invert the values of Alpha in the shader, but if not there's always
the
possibility of pre-inverting them in PD Pro. Click the image for a
fullscreen view (1024x768)>>> |
![]() |
|
And finally, here's a first
rendering done in a 3D program (Eovia's Carrara 4) with global
illumination and realistic sky. We've used the image in the color channel and the black/white image in the transparency channel. Click the image for a
larger view>>> |
![]() ![]() |
|
Here's another example, with a
simple piece of architecture in the scene. This one is a regular
raytraced rendering with just one directional lightsource from the
upper left. (the details under the roof don't get any light and remain
obscured in such case) Click the image for a
larger view>>> |
![]() |
|
Same scene, different lighting, and with Global Illumination skylighting and also indirect lighting enabled. Details under the roof are now visible. Click the image for a
larger view>>> |
![]() |