Compositing image - how to?

Started by N-drju, April 04, 2018, 03:59:16 AM

Previous topic - Next topic

N-drju

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?

[attach=1]

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...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

Maybe you have to do the grass in DS too. Otherwise I don't know.

luvsmuzik

#2
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.

N-drju

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!
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

luvsmuzik

#4
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

Oshyan

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

Matt

#6
Quote from: N-drju on April 04, 2018, 03:59:16 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
Just because milk is white doesn't mean that clouds are made of milk.

Matt

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.

N-drju

Quote from: luvsmuzik on April 04, 2018, 06: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.

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?

Quote from: Matt on April 04, 2018, 09:08:28 PM
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...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

@ luvsmuzik

Damn... I finally get what you meant. I guess my mind is a bit slow lately...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

luvsmuzik

It is sorta like reverse engineering....go way back to the olden days....hehe

N-drju

#11
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.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"