Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

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

ronaldefarmer

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

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

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • 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, 08:37:20 pm »

Not a feature.
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #2 on: January 03, 2016, 08: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, 09:10:37 pm by captaindrewi »
Logged
!

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #3 on: January 03, 2016, 09: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: 293
    • View Profile
    • Ron's Website
Re: Transparent material that can receive shadows?
« Reply #4 on: January 03, 2016, 10: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, 11:01:05 pm by ronaldefarmer »
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 820
  • 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, 11: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, 11:18:41 pm by thecolclough »
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 820
  • 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, 11: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: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #7 on: January 04, 2016, 12:20:59 am »

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: 293
    • View Profile
    • Ron's Website
Re: Transparent material that can receive shadows?
« Reply #8 on: January 04, 2016, 01:23:05 am »



    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: 1446
    • View Profile
Re: Transparent material that can receive shadows?
« Reply #9 on: January 04, 2016, 04:25:02 am »

Same process as I described before

Logged

Hypure

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

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, 05:03:35 pm by Hypure »
Logged