2d rendering of clothing

I am very new to daz 3d and don't have a graphic background at all, am a web programmer who been coding his own game for a long time, now looking to add graphics. 

Am looking to provide a avatar system, where people can select there own clothing for model/avatar they have selected, but sadly I am having trouble achieving what I want to do.

I basically want to render seperate images off models and the clothing, then use CSS coding to layer the clothing on top of the model. However, I believe I need "2d", and flat images (no back on clothing). 

I have an example of the problem I am having 

https://wrestlestarz.c7.ixsecure.com/avatars/test6.php

I have tried everything I can think off, google searched, looked through this website but I can not see a solution, although I am new to daz 3d, so maybe am missing something. 

Daz 3d is fantastic and I realize that what am trying to do with daz 3d is generally not what the program is attended for, as most would render model + clothing together. 

I would also like to check the licensing agreement, and make sure I can use the images generated by the program in way I wish,  couldn't confirm for certain on site. 

I hope someone can point me in the right direction of how to render in 2d or remove the back of clothing. 

«1

Comments

  • ChoholeChohole Posts: 33,604
    edited August 2017

    2nd part of your query.  2d images are fine.

    Post edited by Chohole on
  • LeanaLeana Posts: 11,389

    I think you will need to create a mask corresponding to the part of the clothes that would be visible when worn by the figure.

    Then when you combine your "figure" and "clothes" layer you use that mask to make the part of the clothes which would be hidden fully transparent.

     

    This will enable you to create the mask it if you render with 3Delight: https://www.daz3d.com/mask-and-multipass-toolbox

    For Iray I think you can do that using a "beauty pass" canvas (in the Advanced tab of the Render Settings panel), but I've never used it myself.

  • Leana said:

    I think you will need to create a mask corresponding to the part of the clothes that would be visible when worn by the figure.

    Then when you combine your "figure" and "clothes" layer you use that mask to make the part of the clothes which would be hidden fully transparent.

     

    This will enable you to create the mask it if you render with 3Delight: https://www.daz3d.com/mask-and-multipass-toolbox

    For Iray I think you can do that using a "beauty pass" canvas (in the Advanced tab of the Render Settings panel), but I've never used it myself.

    I figure there must be an easier way to render as 2d and achieve what I want with options already in theprogram,  also a way that can be tested without spending $19.95 on something that might work. 

  • scorpioscorpio Posts: 8,366

    Can you render the figure wearing the clothing save the render as a png and then erase the figure?

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,046

    this can be also done in Carrara using a shadowcatch shader

    another  posibility that is free is Blender, I know that too has a shadowcatch function as I actually used it in Cycles once (I have hardly used Blender but found that shader setting)

    otherwise colour your figure to match the background to make editing in photoshop or Gimp etc easier 

  • patience55patience55 Posts: 7,006

    White background, make the figure to render white, clothing normal. White is usually pretty easy to erase using a "background eraser" in an image editor.

  • ChoholeChohole Posts: 33,604
    edited August 2017

    I must admit if I was doing it I would simply make 2 renders, one with the figure clothed and one wearing underwear.  If rendered to PNG with transparency (alpha layer) enabled would this not work?    and can you do this in D|S.   I know I could do it it in poser, simply by making the figure invisible for one render and the clothes invisible for the 2nd render.

    Post edited by Chohole on
  • do appreciate everyones replies, thank you. 

    I have thought off editing the backs out myself in photoshop, I actually succesfully did this with another test I did, but it takes quite a bit of time and a little awkward to do.

    After thinking more on what Leana said about masking, am wondering if that is like "layering" in photoshop?   have front and back mask, but I don't want to spend money on something to achieve this, as already will need to purchase more skins and clothing once I got this resolved.

    Had to think about what you meant scorpio , you mean erase the model in say photoshop. interesting idea, but that would be awkward, just like removing backs of clothing.

    am not entirely certain what you mean Chohole  , sorry am new to this graphic work, and not certain how to do what you suggest. 

  • LeanaLeana Posts: 11,389
    notretsam said:
    After thinking more on what Leana said about masking, am wondering if that is like "layering" in photoshop?

    Yes, that's the idea. For each item you'd create a render of the figure wearing that item, and then one for the mask corresponding only to the visible parts of that item, and layer the various "item renders" on a background with your unclothed figure using the corresponding "'mask render" to keep only the part of that layer you're interested with.
    That's basically what others suggested too: you make the render with the figure and erase the figure, but you don't do it manually, you use the renderer to create the alpha mask.

    If you use Iray the function needed to generate the masks (beauty canvas) is already included in DS, no need to buy anything.

  • kitakoredazkitakoredaz Posts: 3,526
    edited August 2017

    Actually it can be done by iray canvas, but you may need to set some setting to use iray canvas exposure and gamma correctly. then see iray blog setting. 

    same setting you can use in ds iray render setting.

    http://blog.irayrender.com/post/76948894710/compositing-with-light-path-expressions

    this blog show LPE usage , but I think you can do it without use LPE, but simply use node group and ds iray beauty canvas only.

    I do not know, you need to render nude actor, (render full body without cloth) or you hope to render actor which mask out clothing,,

    if you need full nude actor layer too,, 

    1  make canvas1 without node, set canvas as beauty,, then hide clothing from scene (use scene tab, just click eye icon to hide cloth), then render nude actor .   ds generate exr file, when you save the render image.  (I can not attach this image as full nude, because it is nude,,,sorry, (I modified by hand paint,,)

    2 next clear current canvas, unhide clothing, then set 2 node group first.   node 1 only include actor, node 2 only include pants (or clothing which you hope to mask out)

    then canvas 1 check node1, canvas 2 check node 2. both set as beauty .   then render,   then  save image. with different name.

    this time ds generate 2 exr  (canvas1, and canvas 2).  canvas 1 render, mask out clothing.(then clothing part of actor is transparent)

     canvas 2 render mask out actor, it only render clothing. 

    if you import those three exr images, in photo shop, you can easy larer them as you like. .(can change pants color only etc)

    And you need to adjust exposure value to show exr in photo shop (though I do not know if photo shop auto adjust exposure of exr )

    bodypart.JPG
    1133 x 860 - 200K
    pants1.JPG
    1107 x 871 - 213K
    alphaover.JPG
    1070 x 829 - 199K
    nude.JPG
    1120 x 820 - 196K
    Post edited by kitakoredaz on
  • OK so masking seems to be what am looking for and appears Leana and kitakoredaz are saying the same thing, although am new to this, so having a tough time understanding "how to do what you suggesting".

    I do have photoshop elements, but is that 4 differnet images you rendered in Daz Studio?  or did you save it as an .exr file? 

    if you did save as an .exr file, how do I do that? 

    sorry but I am very new to daz 3d. 

     

     

  • SixDsSixDs Posts: 2,384
    edited August 2017

    "is that 4 differnet images you rendered in Daz Studio?"

    No, the four images that kitakoredaz is showing are actually four screenshots of the use of the .exr images in Gimp, the open source image editing program. Her instructions indicate that she rendered three .exr images: one of the unclothed nude figure; one of the clothing with the figure masked out; and one of the figure with the clothing masked out. The Gimp screenshots show how these .exr images can be used to show the figure with the clothing invisible, the clothing with the figure invisible, the figure clothed, and finally the nude figure, respectively. She actually did render four different .exr images, but didn't use one of them - the one of the clothed figure.

     "save as an .exr file, how do I do that?"

    When using canvasses with Iray, DAZ Studio saves the rendered images as .exr files, by default.

    Since, if I understand correctly, you are only wanting to overlay various clothing items on the unclothed figure, you may actually only need two files: one of the unclothed figure, and one of the clothing item only, which can be layered on top.

    I have an old copy of Photoshop Elements, but I have never used it, so I don't know whether it has the capability of working with .exr files or not. You'll need to check that.

    One thing to keep in mind from the outset is that you'll need to take extra care as you proceed to ensure that you set up your scene (or scenes) just as you want them, then save that scene so it will be exactly the same each time you use it. The figure, its pose, the lighting, the camera view, etc. must remain constant in order for your clothing items to line up or "fit" perfectly. If anything changes, the resulting renders will not work as intended. So get it exactly the way you want it to begin with, save the scene and then be careful not to change anything thereafter. If you should change anything inadvertently, just ensure that when you are closing DAZ Studio and it asks if you want to save the changes, either say "No", or save the scene with a different name so you don't overwrite your original.

    Last but not least, you will want to name all your files in some logical fashion and place them in a dedicated folder on your hard drive in some logical fashion from the outset. It will pay dividends once you have generated a hundred or more files.

    If you need any help setting up your scene or with anything else, folks around here are always willing to help. You'll notice that, in kitakoredaz's screenshots, there is a shadow cast by the figure on the "floor" in her renders, and you may need some help if you do not want that in your renders. Where there's a will, there's a way.

    Post edited by SixDs on
  • kitakoredazkitakoredaz Posts: 3,526

    Thanks Sixds, (I can not tell all detail well as yours),  then one thing if you try iray canvas, in my pic, I actually miss about shadow.blush

    as you can see, all pic make shadow of actor,  then if you simply layer canvas1 and canvas2, . shadow double added and more dark,

    y to avoid it , you need to add one more canvas I think. (I up-loaded pics last nignt,  and see my pic, then find problem sorry)

    You need to set canvas 3, which only rendr shadow . to make shadow only layer.   add one more node group 3, but not check on anything. (empty node group)

    then assgin canvas 3 as node gorup3 still use beauty type. .   then it generate 3 exr, (shadow + actor) (shadow + pants) (shadow only)

    after that you can use shadow only layer, to dodge shadow from another layer. then you can mask out only about actor, and pants.  

  • kitakoredazkitakoredaz Posts: 3,526
    edited August 2017

    NO!  I am sorry, I have believed I can render "shadow only", by above method, but actually when I set node group with anything select, then assign this empty node group

    for canvas (shadow only),    ds  not render  shadow at all. (of couse I still set ground)   I do not know, if it is desigend so.   if inode gorup work such way, canvas 2 should not cast shadow of actor.  may only render pants and  pants shadow.    but actually it cast shadow of actor too. (then only mask out actor) 

    if node group can  mask it, (actor , and pants)  it need to render shadow only  with empty node gorup,  I think .. but no success about shadow only.

    after all, I needed  to render serpately,   without ground, then render actor  only .   and dodge the layer from "acotr with shadow". 

    I  it seems need more step.. can someone make shadow only render, withotu those step?  

    canvas1_actor.JPG
    766 x 824 - 91K
    canvas2_pants.JPG
    845 x 832 - 101K
    canvas3_shadow.JPG
    781 x 843 - 98K
    pantswithshadow.JPG
    1152 x 880 - 205K
    shadowonly.JPG
    1121 x 860 - 206K
    actorwithshadow.JPG
    1152 x 807 - 190K
    Post edited by kitakoredaz on
  • kitakoredazkitakoredaz Posts: 3,526

    Sorry it is not op problem, but I think it is kind of bug about  daz node group and canvas. as you can see,

    if I add another prmitive, then make node group, and check only cube, and  set  the node group  as another canvas, the canvas still show Actor and pants shadow. that means, if I set node group as empty, it need to cast shadow of all item in the scene .(but mask out everything)

    thosugh as I said, I can manage it by ground off, then render, and dodge layer, but if I test samething with blender, exclude item by layer it can show shadow only easy, when I composit multi layer exr.

    cubeonly.JPG
    1164 x 869 - 205K
  • kitakoredazkitakoredaz Posts: 3,526

    So, I sometimes think if I am real geniuscheeky

    I finally found way to  cheat ds .  so ds can not forgive me, to render shadow only if I set  "node group with no selection"

    then I add cube, but at same time I hide cube,  from scene by scene tab. but I can set node group as "cube only"

    that means, ds can not render cube (it is hidden from scene) , but need to render shadow of another figures.

      Then I actually get  shadow only render with iray ground,,

    fakecube.JPG
    998 x 794 - 118K
    fakeshadow2.JPG
    1270 x 917 - 189K
  • SixDs said:

     

    When using canvasses with Iray, DAZ Studio saves the rendered images as .exr files, by default.

    OK I do have rendered images, so how to I access the .exr files? presume there stored somewhere on my PC by the program itself

     

  • kitakoredazkitakoredaz Posts: 3,526

    If you set iray canvas in render settting, like my pic,  then save "render image" in ds (eg png) ,  you  set  path, and image name.  then the  "path " is used to save canvas exrs.

     you should find "(name_canvases")  directory where your saved image(png or jpec etc,,).   in canvases directory, there should be  render canvases.exr

     

  • kitakoredazkitakoredaz Posts: 3,526

    And,, If you did not set canvas, (it is ds default setting of ds),  ds do not generate canvas directory,  just render one image ,  we save it as each format.

     when we set canvas, render and  save image,   ds generate one image(I think) with setting format. and auto generate  canvas directory, where save  each canvas.exr .

    But I do not know which canvas ds will render as "png"  when we set multi canvases. (it is usuall)  if I need to save all canvas as png not exr,, I usually  set  only 1 canvas , then render and save it as canvas1.png,   after that,  clear all canvas, set new canvas2, then render.....   It is annoying,  But I think there is no way to render and save  all canvas as  png  at same time.  aftrer all  most of case, we may use exr to composit  when we use iray canvas, I think. 

     

  • notretsamnotretsam Posts: 74
    edited August 2017

    I had a look at your screenshot of daz studio, and I don't have the same options you do in canvases, as you can see I have nothing in there. 

     

    Post edited by notretsam on
  • notretsamnotretsam Posts: 74
    edited August 2017

    ok nevermind, I see you actually create them yourself in there.

    I can't see all the options you added for canvases nodes , also I don't see option to select "cube" in the nodes options. 

    when I add a node, I just see Genesis and Boxers,  there is no option marked "cube" , as I don't have cube listed on my scenes. 

     

    Post edited by notretsam on
  • also according to this link https://www.daz3d.com/forums/discussion/73745/canvases-and-post-processing

    the .exr file is created when I render image,  but when I render image, I get the .png image + a small .ico file.

    am guessing I got something off in my render settings, but not sure what. 

  • notretsamnotretsam Posts: 74
    edited August 2017

    I now have a .exr file , figured out how to get that when rendering image.

    sadly photoshop elements won't open that file extension, and neither does inkscape.  so will need to download and install gimp now

    edit* 

    downloaded and installed gimp, an it won't load .exr images either.

    is that the rendered .png files you have loaded in gimp kitakoredaz?   

    Post edited by notretsam on
  • kitakoredazkitakoredaz Posts: 3,526

     It seems best ,to check the snowsaltan tutoriall above link.  Actually I frst see this  tutoriall , but it clear enouogh I think with pic.

    http://snowsultan.deviantart.com/art/Iray-Canvas-Tutorial-565641976   

    then,, if ds not generate canvas when you save image,  did you actually add "canvas" and set it? (by + icon click, and set canvas type etc)

    And  I added cube (or any primitive) in the scene,  from ds menu.  because there seems no way to get shadow only, from daz sun light and ds iray gorund.

    after that "hide" it  from scene,   but added it in new node gorup as shadow only.  then render.  it is only way for me to get shadow only layer(canvas) without render separately.  (I thnk there is bug about empty node group, then send bug report today)

  • prixatprixat Posts: 1,588

    I thinks there's an easier way than using canvasses and masks.

    Just switching on the 'Enable Iray Matte' in Parameters, will give you the renders with the back removed.

    (That's one of the Advanced Iray Node properties which have to be switched on via a script in Main menu/Scripts.)

    Put the figure and any clothes in the pose you want them,
    Select just the figure and run that script.
    With only the figure still selected go to parameters and turn on the new property.
    Render to PNG.
    Change clothes, Render...
    ​Change clothes, Render...
    ​Change clothes, Render... etc.

  • kitakoredazkitakoredaz Posts: 3,526

     then I do not know, there is setting which may not generate exr, when I set canvas, and render it (as snowsaltan show, we can choose active canvas, in rendersetting>edit section,but  I have never change it.   it not matter,   which canvas I choosed as active, about exr.   after save the render image (active canvas)  as one  png,  ds save all canvas exr, in name_canvas directory for me. I do not set any spetical thing,,,

     If I set only one canvas, ds only save one exr. if I set three canvas, then render and save, ds save one active render image(png) + three.exr in canvas directory.If the way can not work, (use exr and layer them),  you may try, render each active canvas, and save one by one,, and use those png to composit.it is more simple I think,  if 2d editror can not load exr, this way still work.  but need render each canvas,  one by one, and lost  flexibliity to adjust exposure, with high range. 

  • kitakoredazkitakoredaz Posts: 3,526
    edited August 2017

    I think if you use render library, to save your render image? I usually not use render library, but set directory when I use canvas.

    when you save render, (set name), there is small drop down menu. and set icon as fola icon. now you can choose directory more clear,  where you save the png.

    then in same location, you should find, canvas directory. (hope it work for you)

     

    saveinfolda.JPG
    642 x 787 - 108K
    Post edited by kitakoredaz on
  • kitakoredazkitakoredaz Posts: 3,526

    Thanks prixat ,  your  suggestion way is actually more easy for OP purpose I feel. 

     I have never thought to use iray mat like that.   so not retsam really feel difficulity about canvas things,  try it.

    you can find,  iray mat script ,conent library>(your ds library root)> scripts>Utilities  there is "Create Advanced iray Node properties"

    after applied it to your actor figure, go to parameter >display  then Enable iray matte.  just  follow prixat guide.  if not up-date your view port, render once.

    after that, you can see, only clothing rendered (mask out figure).

    Actually,  I use scene light, and hope to get shadow only canvas ,  I needed  to use  iray mat fro shadow catcher. (but not plan to use it for actor, at all ^^;)

  • prixat way would be perfect, this means I can render without the backs on clothing, sadly I ran into a problem

    The render window on the right is what I got after I enabeled iray matte

    This is what I did

    I hid the model and bottoms, left just the t-shirt in the viewport

    I double clicked the "Create Advanced Iray Node Properties" script (can see on screenshot , highlighted) 

    Which then the "Enable Iray Matte" option showed up under "Parameters > Display", which you can see on right off image. 

    I enabled Iray Matte, then rendered the image

    The render window you see on the left, is what would typically show without the iray matte enabled 

    so am guessing I went wrong somewhere,  since am very new to daz studio, would need a step by step instructions on what you suggesting prixat, hope you don't mind.  

  • kitakoredaz I haven't quite managed the way you suggesting but I did find a solution based on what you saying, that can work but sadly its a little awkward.

    I can do the following;

    1. Render model seperately from the clothes, so I have an .png image of the model and each of the clothes.
    2. I then load up they images in photoshop elements
    3. I can then copy/paste the clothes into the model layer, so then I have differnet layers in the one viewport 
    4. Then I can use "Layer Mask" on the model and hide that, so just the clothes viewable.
    5. Then I zoom into clothes (like 500%)
    6. Then I use eraser tool to remove the back of clothing.

    I tested it with boxers clothing image this morning, it worked but a little tricky, so hopefully I can get prixats way working. 

    End of day, doesn't matter how I do it, its going be time consuming to do, which is to be expected. 

Sign In or Register to comment.