Author Topic: Compositing image - how to?  (Read 454 times)

Offline N-drju

  • Member
  • *
  • Posts: 1231
  • A ship in port is safe... well, fine by me.
Compositing image - how to?
« on: April 04, 2018, 07:59:16 AM »
I can't figure it out... I would like to render a person in DAZ Studio and then put him into a render. But, he is sitting on the ground and I would like the grass blades to actually obscure part of his body. As you may imagine, just pasting the person in, produces completely unnatural effect - as if they were stickers put over an image.

Since a fashion for stick figures has recently sprung up, (nudge, nudge) I also include a simple drawing on what I want to achieve in my render. The question is, if there is any way in TG to actually do something like masking the objects out using other objects, with relation to distance?

80640-0

What I did so far, was to produce the so called "extra output images", that give a nice alpha channel coverage of whatever object you want. This works great if your camera is more or less leveled and you can clearly define the vegetation outlines. This time however, my camera is at a slight angle and I use grass patches that make it impossible to clearly identify the "border" of grass blades...
"Error 404 - pun not found."

Online Dune

  • Terragen Alpha Tester (Win)
  • ***
  • Posts: 14051
    • www.ulco-art.nl
Re: Compositing image - how to?
« Reply #1 on: April 04, 2018, 03:21:07 PM »
Maybe you have to do the grass in DS too. Otherwise I don't know.

Offline luvsmuzik

  • Member
  • *
  • Posts: 2667
    • luvsmuzik 1995
Re: Compositing image - how to?
« Reply #2 on: April 04, 2018, 03:36:16 PM »
If you are really good, in your paint program... PS or Gimp, you can take a selection of your grassfield, where you want your object to sit, mask  (erase carefully to separate grass blades) it on a new transparent layer and then paste it as an overlay with your render of scene with person sitting.  Or copy grass layer and erase all you don't want in the overlay, very steady hand required. Gimp used to have a few different methods of doing this masking.

I also do not know much about card TG projection. May be possible to do it that way using a masked person sitting (like the old sprite objects) In the olden days you had to be creative and did trees and flowers that way.
« Last Edit: April 04, 2018, 03:52:25 PM by luvsmuzik »

Offline N-drju

  • Member
  • *
  • Posts: 1231
  • A ship in port is safe... well, fine by me.
Re: Compositing image - how to?
« Reply #3 on: April 04, 2018, 07:46:29 PM »
Hmmm, somehow, I felt this is going to be tough... ::) I did something like this only once. But in that instance, the camera was slightly tilted upwards and it was really easy to make an alpha out of the front vegetation. Then, I was able to erase the portion of that person using that alpha.

I think luvs that it requires more of a good eye rather than skill. ;) You have a point there. After all, everything I need is just a mask that will allow me to erase parts of a person's body.

I also have a "dirty" method as a last resort - given the fact that my grass layer will be very thick, I am also thinking about simply randomly erasing a person, so that greenery shows through. Not very accurate on its own, but should be indistinguishable to the naked eye... Grass-like and fiber brushes could really help!
"Error 404 - pun not found."

Offline luvsmuzik

  • Member
  • *
  • Posts: 2667
    • luvsmuzik 1995
Re: Compositing image - how to?
« Reply #4 on: April 04, 2018, 10:52:43 PM »
A better mask should be done...but a card projection would work and shows shoes and jeans behind vegetation. Here I just grabbed a photo and did it the old way with eraser method.

I know nothing about DAZ, but if you can position your figure, render in DAZ with white background, then render an alpha layer? would not this mask fit perfectly? I saved both as jpg and used on card as color image and opacity image
« Last Edit: April 04, 2018, 11:16:20 PM by luvsmuzik »

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 12366
  • Holy snagging ducks!
Re: Compositing image - how to?
« Reply #5 on: April 05, 2018, 01:07:15 AM »
I believe you could potentially output a Depth Map and use that for masking (select a specific range of grayscale values corresponding to the desired depth). Would take some experimentation unless your compositing app natively supports depth (e.g. Nuke, I believe, or Natron probably).

- Oshyan

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3204
  • I'm the crazy one
Re: Compositing image - how to?
« Reply #6 on: April 05, 2018, 01:08:28 AM »
The question is, if there is any way in TG to actually do something like masking the objects out using other objects, with relation to distance?

There's a feature in Render Layer that lets you set the near and far clipping planes of a render. Maybe you can use this? Clipping distances are distances from the camera. If the guy is 5 metres away from the camera, you could render a foreground layer with Near = 0 and Far = 5.

Matt
« Last Edit: April 05, 2018, 01:14:47 AM by Matt »
Just because milk is white doesn't mean that clouds are made of milk.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3204
  • I'm the crazy one
Re: Compositing image - how to?
« Reply #7 on: April 05, 2018, 01:18:32 AM »
Another solution is to add a holdout object where the guy is, just for your foreground render. It could be a plane that is large enough to cover the guy. The object can be set to "holdout" mode. The foreground render could be a cropped render around the guy.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Offline N-drju

  • Member
  • *
  • Posts: 1231
  • A ship in port is safe... well, fine by me.
Re: Compositing image - how to?
« Reply #8 on: April 05, 2018, 06:08:19 AM »
A better mask should be done...but a card projection would work and shows shoes and jeans behind vegetation. Here I just grabbed a photo and did it the old way with eraser method.

Luvs, sorry, but I still don't get how did you get the grass in front of the guy so pixel-perfect... Maybe I'm just too stupid to grasp what you are trying to explain... I mean, the sitting mask does nothing to determine what parts of the pasted object / person should be erased! :( Does it?

There's a feature in Render Layer that lets you set the near and far clipping planes of a render. Maybe you can use this? Clipping distances are distances from the camera. If the guy is 5 metres away from the camera, you could render a foreground layer with Near = 0 and Far = 5.

I was thinking about using a render layer, but was never too sure how to use it. So you say a render layer can actually render the picture only up to a certain distance and then stop? Will that work for extra output images too?

Hmm, holdout mode seems to be damn useful indeed! But then, when you think about how DAZ Studio and TG-rendered objects differ in the end (see my other topic) it looks easy no longer... ??? Though, again, you probably don't have to be so pixel perfect...
"Error 404 - pun not found."

Offline N-drju

  • Member
  • *
  • Posts: 1231
  • A ship in port is safe... well, fine by me.
Re: Compositing image - how to?
« Reply #9 on: April 05, 2018, 03:08:44 PM »
@ luvsmuzik

Damn... I finally get what you meant. I guess my mind is a bit slow lately...
"Error 404 - pun not found."

Offline luvsmuzik

  • Member
  • *
  • Posts: 2667
    • luvsmuzik 1995
Re: Compositing image - how to?
« Reply #10 on: April 05, 2018, 03:29:53 PM »
It is sorta like reverse engineering....go way back to the olden days....hehe

Offline N-drju

  • Member
  • *
  • Posts: 1231
  • A ship in port is safe... well, fine by me.
Re: Compositing image - how to?
« Reply #11 on: April 05, 2018, 07:59:21 PM »
Ok, I think I will manage it from now on. The "holdout" object option is an excellent solution (thank you Matt) and the resulting mask can be used on the actual rendered person.

The only nuisance remaining are slight differences between perspectives in TG and DAZ Studio. The position, camera and zoom settings in DS seem to be quite wobbly... But then again, you can of course argue that it's the TG settings that are wacky... Depends which point of view you take. ::) An object rendered in DAZ Studio seems to always be a bit bigger than its counterpart placeholder in TG. Even if camera coordinates and settings are copied bit by bit.

Anyway, I think the holdout and exact coord copy will work just fine.
« Last Edit: April 05, 2018, 08:00:54 PM by N-drju »
"Error 404 - pun not found."