KeyShot Forum

Technical discussions => General discussion => Topic started by: MariuszTelega on June 20, 2020, 11:00:16 AM

Title: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 20, 2020, 11:00:16 AM
Help needed.  I am creating shop with furniture.  There will be possibility to able or disable shelves and some other elements inside the furniture unit by simply clicking the choose field.  My question is:  can I render cabinet with hidden shelves but somehow forcing keyshot to not take shadow of this shelf off  ??    So I hide any part of rendering unit but when hide this part the shadow of this part stays on.  If my question is not clear I can send graphic with explanation.  Can anyone help me. 
Title: Re: hiding elements but leaving the shadows on
Post by: TGS808 on June 20, 2020, 02:31:11 PM
If I'm understanding correctly, you want to hide a part but still have that part cast its shadow even though it isn't there. To do this, set your material up as a multi-material. In addition to your main material for the part add an emissive material. Uncheck "visible to camera", "visible in reflections" and "two-sided". Check "visible in shadows". That will hide the part but leave the shadow. By setting it up this way you can go back and forth between the main material (visible part) and the emissive material (hidden part, casts shadow).
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 21, 2020, 12:09:32 AM
thanks TGS for your help - this is what I wanted to do
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 23, 2020, 04:06:33 AM
Hi TGS808 - I have one more quastion maybe you could also help me with this.  It is related to the last one.  Is it possible situation where I have the cabinet with shelves and I hide all the parts of this cabinet and keep shelves on but the shelves keep the shadow even though the cabinet parts are switched off ?  I need this for my www where I have cabinet and I can add by clicking button shelves inside and I would like them to appear with shadows so this cabinet looks natural.  Thanks again. 
Title: Re: hiding elements but leaving the shadows on
Post by: TGS808 on June 23, 2020, 10:28:17 AM
Sounds to me like you want the cabinet (that has been hidden) to cast its shadow on the shelves that are visible. If that is correct, you should be able to do this the same way. Assign the hidden parts of the cabinet an emissive material and like before, make it visible in shadows but not visible to camera or in reflections. The shelves should pick up the shadows from the cabinet even though it is not visible.
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 24, 2020, 03:46:13 AM
Hi TGS.  I put .PDF to show you what I am planning to do.  In .PDF file you have draft but this all will be done in keyshot and will be placed on our website.  I transport files from topsolid and  I am looking for the best sollution about rendering separate elements.  These elements will appear by clicking choice window and I am tring to make it look natural.  When I did cabinet rendering and then shelves rendering with hidden cabinet and the website guy put this together it looked not natural.  Thanks for your help again.
Title: Re: hiding elements but leaving the shadows on
Post by: TGS808 on June 24, 2020, 06:38:30 AM
It may help to see the results you got. Can you post them?
Title: Re: hiding elements but leaving the shadows on
Post by: INNEO_MWo on June 25, 2020, 01:11:49 AM
If you want to render objects, but need some invisible parts that are catching the shadows, then use the ground material for the body parts. Just like the ground plane, the ground material will catch shadows but isn't visible in the rendering. BUT! - you'll need to activate the experimental features so that you can use the ray mask in the ground material.
I guess the description is a bit confusing. Attached you'll find a KeyShot 9 scene with an object and shadow catching parts with the modified ground material - and as well the raw render.
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 25, 2020, 10:10:12 AM
to give you more idea what I am working on and I had usefull hints from you I am attaching the picture with wardrobe.  As you can see when I rendered shelves and cabinet separately it looks kind of not natural because the shelves are not giving shadows.  Idea of this is that the customer will be able to add each shelf by choosing on the right side if he/she wants 1, 2 or more shelves.  What I am doing now I am trying to use TGS 808 idea.  When I have resolts I will show you.  Thanks again for your help
Title: Re: hiding elements but leaving the shadows on
Post by: HaroldL on June 25, 2020, 11:29:10 AM
It's going to look a little odd having a shadow of a shelf with no shelf. What you likely need is for the shelf/shelves and the resulting shadow/s to render together on a separate render layer. ???
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 25, 2020, 12:06:21 PM
I did not know that I can use layers  and render.   I am using pro version  ks9 just few days so I did not get to this option yet. 
Title: Re: hiding elements but leaving the shadows on
Post by: TGS808 on June 25, 2020, 02:07:10 PM
When the user clicks to add a shelf, it's not just adding the shelf to the existing image of the empty cabinet, is it? I would imagine the cabinet image with no shelves gets swapped out for a completely different image of the cabinet with however many shelves the user decided to add. Unless you're up to some kind of PNG layering, coding trickery that I'm unaware of (and that could surely be the case) it seems that you could solve this by simply rendering multiple images of the cabinet. An empty version, a version with one shelf, a version with two shelves, and so on.
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 25, 2020, 09:42:45 PM
Hi all.  I did try the layers option and it really works.  You can then work on this layers in photoshop and you have the shadows and everything.  This is great option.  The only problem is that I think it is not working perfectly because you have to check the layers you make.  KS sometimes moves other part that you have not chosen to the layer that you do not need this.  Also when you add more then 3 layers for example 4 or 5 with different objects somehow it renders only 3 layers.  I do not now why.  Anyway even having working on 3 layers where you can put objects it is great sollution.  I think I found best way now.  Thank you for your help.
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 25, 2020, 10:40:29 PM
I am sending what happens when I use layers (it is only test - so I made it on low quaity) the issue is layers.  Maybe you Harold have solution for this.  I rendered layers and all is fine except the cabinet.  Shelves and others render on separate layers but the cabinet has the white spots.  How can resolve this ?
Title: Re: hiding elements but leaving the shadows on
Post by: HaroldL on June 27, 2020, 02:30:12 PM
It's likely that I gave you a wrong solution. I don't use render layers myself and forgot that KeyShot does not render whatever is behind the object that is placed on a different layer. Render layers are provided so you can stack them in Photoshop to do additional retouching if needed. You would have to do some "touch up" in your photo editing program to fill in the blank spots left by the shelves moved to their own layer.
I would have to agree with TGS808 (https://forum.keyshot.com/index.php?topic=26419.msg111429#msg111429) and suggest that you use his solution - render out an image of the cabinet with all the combinations of with and without shelves. You will need a Model Set and Studio for each image which to my count would be about eight.
Title: Re: hiding elements but leaving the shadows on
Post by: MariuszTelega on June 29, 2020, 02:00:07 AM
I used both ways layers and TGS808 idea and it works fine.  The idea to render all options separate is ok but I have about 50 cabinets which would give many possibilities and it would take to long time.  When I finish this project I will share resolts with you.  Thanks again for your help.