Author Topic: Foreground alpha channel?  (Read 224 times)

Offline N-drju

  • Member
  • *
  • Posts: 755
  • Changes, changes, changes...
Foreground alpha channel?
« on: March 22, 2017, 04:54:41 PM »
I am going to make a composite image - DS rendered object and people and TG generated environment.

The problem is that there are some plants (tall grass and ferns) between the camera and the supposed location of the house and people. I can't just carelessly paste the DS render over these plants...  ::)

The question then is - how can I capture the shapes of those grasses as an alpha channel and then erase those parts of the DS render that collide, thus, bringing the front vegetation back into the final product?

Thanks for help and ideas. :) Reference image below, so you can see what I'm trying to do:


"I don't know what 'pokygon' is but I like it."

Offline Dune

  • Member
  • *
  • Posts: 12032
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Foreground alpha channel?
« Reply #1 on: March 23, 2017, 06:18:11 AM »
I think you could use the depth pass and work on the greys in PS to 'cut' out (make very white, rest black) only the front grasses and use that as blending mask.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline N-drju

  • Member
  • *
  • Posts: 755
  • Changes, changes, changes...
Re: Foreground alpha channel?
« Reply #2 on: March 23, 2017, 01:33:54 PM »
Aaah, I cracked it. In Terragen. I posted this topic because I thought something changed from TG2 to TG3 but it's the same. A little more complicated maybe, but it's just the same.

If you dig deep enough in your Terragen 2 and "My documents" folder (yeah, I know - sorry Apple users :P) you can find extra white-out images. White color is put in place of everything, terrain, objects, except for the sky. This can later be used as a mask for whatever purpose you desire. That is, if you control it appropriately.

In Terragen versions starting from #3 you need to do the following to get an "alpha mask" for composite renders:

1. Deactivate all objects except the ones that you want "alpha masked". If it is a part of one or more populations just mask the relevant area with SSS or painted shader, I don't know...
2. Deactivate the planet surface. The population will be planted correctly, so don't worry.
3. In the Render tab open your render settings. Go to sequence/output tab.
4. Check "Extra output images" - this is the crucial point!
5. Pick a directory where the said extra output images will be created.
6. Hit the "Render all to disk" button (as of TG3).
7. Go to the directory that you chose for extra output images. You should see a duplicate full-color image and also another black image with white mask painted exactly in the spots where your "alpha-masked" objects are sitting.

Then, use PS or any other program and composite the image. It may require some adjustments as far as the edges of the foreground objects are concerned but this is actually the easiest part, trust me!
"I don't know what 'pokygon' is but I like it."

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2790
  • I'm the crazy one
Re: Foreground alpha channel?
« Reply #3 on: March 23, 2017, 01:43:54 PM »
Just like TG2, in TG3 and TG4 you can have renders automatically saved to My Documents (or any other location of your choice). It's an option in Preferences -> File Saving. It is turned off by default.
« Last Edit: March 23, 2017, 01:45:57 PM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

Offline N-drju

  • Member
  • *
  • Posts: 755
  • Changes, changes, changes...
Re: Foreground alpha channel?
« Reply #4 on: March 23, 2017, 01:51:05 PM »
With alpha channel cutouts?
"I don't know what 'pokygon' is but I like it."

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2790
  • I'm the crazy one
Re: Foreground alpha channel?
« Reply #5 on: March 23, 2017, 05:10:36 PM »
As with TG2, if you enable the option to automatically save renders then it saves two images: RGB and alpha.
Just because milk is white doesn't mean that clouds are made of milk.

Offline luvsmuzik

  • Member
  • *
  • Posts: 1162
Re: Foreground alpha channel?
« Reply #6 on: March 23, 2017, 06:15:36 PM »
Well, now this is nice to know. Thanks for asking that!