Render clothing only (no base figure) while not showing hidden/rear parts

Hi there,

I think this is my first time posting on this forum so please be gentle :) I'm not an expert in these areas so apologies if my questions are ignorant, or if people have solved these problems a million times before and my googling just isn't good enough.

I am currently an indie developer who is making a 2D game which includes an inventory/paper doll system. I have been using DAZ Studio for many years and the thought occurred to me that I could use the stuff I've bought to render clothing/armour which I could then overlay on top of a base figure, since in my game everything is a 2D layer.

So far so good. But the issue is how to "cut out" the parts of the clothing that would sit behind the base figure, for example the back of a helmet.

These are the options I've thought of:

1) Fit the clothing to the base figure. Hide the base figure. Render the clothing. Use PhotoShop to manually erase the parts that wouldn't be visible.
I don't like this idea because it would be incredibly manually intensive - I'd have to work on each item of clothing or outfit individually, and if I don't do it perfectly it will look terrible. However, it does have the advantage that if the base figure isn't rendered, transparency effects will work correctly (see 2 and 3 below).

2) Colour the base figure bright green. Fit the clothing to the base figure. Render the clothing on top of the base figure. Use PhotoShop to select by green colour and hit delete. (Basically similar to a green screen in a movie studio).
Slightly less manually intensive than 1, but is prone to leaving some artefacts around the edges. Also, for semi-transparent layers or things like lace, the green background shows through and tints the base figure green.

3) Colour the base figure white. Fit the clothing to the base figure. Render the clothing on top of the base figure. Use PhotoShop to select by white colour and hit delete.
Somewhat solves the problem of the greenish tinge on the base figure, but lightens the colour of base figures with dark skin at those areas. Is also prone to some edge artefacts like 2. Also, will need to manually deselect any white items of clothing accidentally selected, which increases the manual effort slightly more than 2.

Ignore shadows for now as I've read the excellent shadow catcher guides on this forum and I have that aspect working very well.

Is there another, better option than the above that I haven't thought of? Is there some magical way to have a "transparent" base figure that also blocks out anything behind it?

Any ideas would be welcome here because none of my 3 options above are great.

Thank you.

Comments

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,202
    edited April 2022

    you can apply the Create Advanced Iray Node Properties.dse script to a figure wearing the clothing (under scripts utilities in your library) and enable iray mat

    then the figure will hide anything behind it

    Post edited by WendyLuvsCatz on
  • Oh wow, so I can apply the iray mat to an invisible figure? I used that as a shadow catcher (white object) and it worked well, but I didn't know I could do that with an invisible object. I'll give that a go, thank you.

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,202

    yes, it is basically another name for a shadowcatcher shader, the figure is not invisible as such rather it becomes the background

  • Hi Wendy. Quick update: I tried your idea and it sorta works, but you can see the ghostly impression of the base figure especially where it's near the outfit. Am I doing something wrong, or is this the way it works in DAZ Studio?

    Test render

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,202
    edited April 2022

    you probably need very even lighting as well, an all white HDRi and no emitters/sun node

    a PBR render engine is always going to cast shadow, maybe use Filament

    Post edited by WendyLuvsCatz on
  • ZiconZicon Posts: 309
    edited April 2022

    This is a job for canvases. Find them in the Render Settings tab under Advanced and Canvases.

    Enable Canvases and create a new canvas. Set the Type to Beauty and enable Alpha. Create a Node List and check just the clothes. Use this node list in the Nodes setting for the canvas you created.

    The result is an image with just the checked nodes rendered, complete with alpha channel for easy compositing. Here you can see the result of a regular beauty render vs a clothes only beauty render.

    Render Settings.png
    536 x 452 - 18K
    Node List.png
    453 x 315 - 10K
    Canvases-All-Beauty.jpg
    1080 x 1080 - 163K
    Canvases-Clothes-Beauty.jpg
    1080 x 1080 - 130K
    Post edited by Zicon on
  • Richard HaseltineRichard Haseltine Posts: 100,765

    argy_81abfbccee said:

    Hi Wendy. Quick update: I tried your idea and it sorta works, but you can see the ghostly impression of the base figure especially where it's near the outfit. Am I doing something wrong, or is this the way it works in DAZ Studio?

    Test render

    This is because, as Wendy said, the Matte acts as a shadow (and reflection) catcher.

  • Thanks for the help everyone. I think I'm almost there!

    Wendy and Richard: Actually, I got it working perfectly after toggling "Visible in render" off and on again. I don't know if this is a bug, but doing this made the base figure completely transparent but still catching shadows, which is actually what I wanted.

    Zicon: I had never heard of canvases, and they also work really well except that they don't catch shadows, so when I place the clothing layer on top of the base figure layer in PhotoShop, it looks a bit "off" because the shadows aren't there (e.g. under the brim of the hat). However, I can see that this could be an extremely useful tool for what I'm doing and am going to play with it some more.

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,202

    also make sure you are rendering to png or some other format with an alpha channel and your sky or dome visibility is unchecked so you get a transparent background and bits where the figure is

  • I've finally got this working! Here is my base layer, rendered normally without the environment dome visible:

    Base layer

    Here is just the hat without casting any shadows, using the iray canvas technique suggested by Zicon:

    Hat only

    And here is the hat's shadow, using both the iray canvas technique and the iray matte turned on for the base layer (note that I've added a white background layer so that you can see the shadow better):

    Hat shadow

    And finally, here is everything put together as layers in PhotoShop:

    All layers

    Thank you so much to Wendy, Richard and Zicon for their help. I really didn't think what I was asking for would be possible in Daz Studio! Here I was prepping myself for hours of manual labour selecting/cropping/masking/deleting for hours of my life, but it's all possible with a few clicks of some buttons :)

     

  • Hi guys, me again. One thing I have noticed is that the shadows cast by any object with iray matte enabled are nowhere near as strong as an object without iray matte. Is there any way to play with that setting to get more intense shadows to match a "normal" object?

  • Richard HaseltineRichard Haseltine Posts: 100,765

    Adjust the colour of the shadow-catcher.

  • rikvonkrikvonk Posts: 9

    Heya all,

    I was looking for exactly this also, thanks for all the techniques. I also would like to have the cast shadows also, but for me the cast shadows turn out like this:

     

    How can i fix it to not make it "paint" on the and let its skincolor shine trough, but actually just only make a blackish shadow which i could use as an overlay? I can use this as an overlag ofcourse but it could interfere with other features( For example glasses) or clothing.

    hoofd2.png
    700 x 700 - 529K
  • Richard HaseltineRichard Haseltine Posts: 100,765

    If you want pure shadows make the skin and other surfaces on the figure unglossy in the Surfaces pane (select the whole figure and adjust the strength settings for anything related to shineiness to 0, click the colour picker for Base Colour and make it black).

  • Richard HaseltineRichard Haseltine Posts: 100,765

    This is actually Genesis 3 as I need to fix a Duplicate Formula issue with 8 so it was using a 3Delight shader, but it shows the result of killing the glossiness and scattering effects

    Test Matte.png
    1000 x 1000 - 1M
  • rikvonkrikvonk Posts: 9

    Aaah great! Exactly what i was looking for, thanks alot mate!

     

Sign In or Register to comment.