Compositing Character Into 2D Plane Grass

I’m having problems getting my character composited into some grass I’ve made using planes, textures and alpha maps. The grass and the character are on two separate render layers. I thought I could use a Mask Layer to make it look like the character is standing in the grass, but the Mask Layer seems to only recognise geometry instead of the actual alpha maps. That means I get rectangular blocks taken out of the character as opposed to detailed grass silhouettes.

Is there a way to get around this?

I would appreciate some help, thanks in advance.

It is difficult to know what you have done by this simple description. Perhaps some screen shots?

I’d like the scene to look like this, with the grass in front of the cube:


But if I render the grass and the cube on separate render layers, then composite them back together with Alpha Over or Z Combine nodes, I get this result:


The grass doesn’t show up in front of the cube, making the cube look like it’s floating instead of being in the grass.

I thought I could fix this using the grass as a layer mask in the Render Layers, but since the grass is made out of 2D planes with textures on them, the mask doesn’t register the transparency of the texture and instead masks the rectangular outlines of the planes.

(continued in next post)

Attachments


(Sorry I can’t get rid of the third image in the last post)

Here I’d like the mask to be the shape of the outline of the grass:


But the layer mask only recognises the plane so the mask result I get is this:


Maybe there’s some other way to mask the grass using the alpha texture?

Z depth doesn’t include alpha from objects. But Mist pass does. Try that instead.

Can’t you do the grass blades using geometry instead of planes with alpha maps?

Steve S

Might kill animation render times?

Strange, the first image in the previous post doesn’t seem to be working.

Anyway, I managed to improve it, I think - instead of using a black and white alpha map, I used the alpha channel of the diffuse map, as in this setup: http://blendernerd.com/wp-content/uploads/2011/11/Selection_005.png

I got this result with 1000 samples:

[ATTACH=CONFIG]321133[/ATTACH]

It’s still kind of noisy at the edges, but I guess more samples’ll fix that?