Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Transparent material that can receive shadows?  (Read 9020 times)

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Ron's Website
Transparent material that can receive shadows?
« on: January 03, 2016, 02:17:20 pm »

Does anyone know of a way to make shadows appear on a transparent material?
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #1 on: January 03, 2016, 03:37:20 pm »

Not a feature.
Logged
¼

captaindrewi

  • Sr. Member
  • ****
  • Posts: 490
  • errm...errr?
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #2 on: January 03, 2016, 03:59:40 pm »

Think one can can't one?
Set the object to receive shadows.
Is this what you mean or do you refer to something more specialised and complex?
« Last Edit: January 03, 2016, 04:10:37 pm by captaindrewi »
Logged
!

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #3 on: January 03, 2016, 04:41:56 pm »

A totally transparent object technically can't reflect light, so naturally shadows can't be displayed on it. Custom shaders that could bypass this aren't a feature in Anim8or yet.

The long way around is, you can render the scene in completely white (including the transparent object) with solid materials and capture just the black shadow. Then in an image editor blend this image on top of a the regular, non-shadowed version of the scene that doesn't contain the transparent object. This creates a shadow on a transparent object.
Logged

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Ron's Website
Re: Transparent material that can receive shadows?
« Reply #4 on: January 03, 2016, 05:32:41 pm »

Thanks for your response everyone. I realize that it isn't something that could happen in the real world, but what I'm trying to do is capture the shadows of objects while saving to PNG with transparent background.


 


Imagine that the yellow object beneath is not visible, but that the shadows remain visible overlaying the transparent background. I have tried to find a suitable workaround in an image editor, but I haven't quite been able to achieve the result that I want. The idea is to have the shadows appear to fall on an image behind the PNG such as a background image in a webpage.
« Last Edit: January 03, 2016, 06:01:05 pm by ronaldefarmer »
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: Transparent material that can receive shadows?
« Reply #5 on: January 03, 2016, 06:17:14 pm »

...but what I'm trying to do is capture the shadows of objects while saving to PNG with transparent background.

how i'd do it (admittedly involves a 2-pass render process, and a medium/advanced graphics package):
  • do two new versions of the render, saving both as RGBA PNGs:
    • #1: one which has the yellow object, but change its material so that both its diffuse and its ambient are set to RGB 255,255,255 (for this pass, you might have to temporarily change the light type to infinite instead of local, to prevent that funny extra ring of shadow around the edge of the yellow object)
    • #2: one without the yellow object
  • in your graphics package (personally prefer GIMP, but whatever):
    • load render #1
    • give it an alpha channel derived from the existing luminance data (if using GIMP, you'd right-click the layer in the layers dialogue, pick 'add alpha channel' from the menu, and then select the 'greyscale copy of layer' option; can't give detailed instructions for Photoshop or other packages)
    • invert the alpha data so that the shadows will become opaque and the background transparent (instead of the other way round, which would be the default result in GIMP and possibly in other packages)
    • change the layer's brightness, making everything as dark as possible - this should stop the background shadows from having a white feathering around their edges in the final result - but being careful not to change the alpha data again while you're at it
    • load render #2, and paste it as a new layer on top of the one you've just modified
  • ...and that should do the trick, unless i've been clever and missed something...
« Last Edit: January 03, 2016, 06:18:41 pm by thecolclough »
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: Transparent material that can receive shadows?
« Reply #6 on: January 03, 2016, 06:19:46 pm »

also, don't know if you'd noticed, but in your current setup the right-hand edge of frame is clipping one corner off the shadow of the dodecahedron, and same with the cube at the bottom edge...
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #7 on: January 03, 2016, 07:20:59 pm »

I think we all miss-understood your question  ::)
I think what you are referring to is a shadow catcher... which is not feature.


Ask Steve about it *nudge* *nudge*
Logged
¼

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Ron's Website
Re: Transparent material that can receive shadows?
« Reply #8 on: January 03, 2016, 08:23:05 pm »



    I think what you are referring to is a shadow catcher... which is not feature.


Yes, shadow catcher. I never heard of it before but that is exactly what I want to do.



This is a little bit closer. I'm experimenting with using a transparency map. I could probably edit this to work, but to get really good results, a special transparent material that only shows shadows would be useful. I will add it to my already lengthy wish list.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #9 on: January 03, 2016, 11:25:02 pm »

Same process as I described before

Logged

Hypure

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #10 on: January 25, 2016, 11:55:28 am »

If your going for a single frame of animation you could use a white object to receive the shadow, then upload that frame into a paint program and change whites to alpha.  Then use that PNG image on top or your background.

I use "graytoalpha-by BoltBait" in paint.net, it says gray to alpha but you have the option to do white also.

Sorry i'm so late with this, it just now occurred to me.
« Last Edit: January 25, 2016, 12:03:35 pm by Hypure »
Logged