give shadows to transparent material ??

General discussion related to SketchUp Pro and Make

give shadows to transparent material ??

Postby simon le bon » Sun Aug 23, 2009 10:51 pm

Is anybody knows if it is possible to overpass the native SU limitation to cast shadows for transparent materials ?

- a note taken in SU guide:

Note - Faces with less than 70 percent opacity are considered
transparent, and do not cast shadows. Faces with 70 percent opacity or
greater cast shadows. Transparent faces cannot receive shadows. The
following image shows a transparent (less than 70% opacity) rectangle that
does not cast a shadow (left) and a opaque (70% or greater opacity) rectangle
that does cast a shadow (right).


*simon
0
User avatar
simon le bon 
 

Re: give shadows to transparent material ??

Postby TIG » Sun Aug 23, 2009 11:05 pm

If you want a 75% transparent thing to cast NO shadows then group it and in its 'Entity Info' set it to 'cast no shadows'...

If you want a '50%' transparent thing to cast a shadow then you need to apply a transparent png texture to the material of the faces, that will cast a shadow even though it's completely transparent - you will need to change its transparency to ~75% to make a shadow BUT it will still appear transparent anyway... If you want the level of transparency to vary then adjust that etc in a copy of the png...

I've attached a png for you to try, it's fully transparent, but can be adjusted in an image processor...
just+a+shadow.png
0
TIG
User avatar
TIG 
Global Moderator
 

Re: give shadows to transparent material ??

Postby simon le bon » Mon Aug 24, 2009 12:54 am

Dear Tig,
If you want a 75% transparent thing to cast NO shadows then group it and in its 'Entity Info' set it to 'cast no shadows'...
:thumb: :thumb:

If you want a '50%' transparent thing to cast a shadow then you need to apply a transparent png texture to the material of the faces, that will cast a shadow even though it's completely transparent - you will need to change its transparency to ~75% to make a shadow BUT it will still appear transparent anyway...

Hum ! It seems to be an excellent tip, but I don't succeed to make it work! :(
I have tried this in several ways: to import the transparent PNG as a picture, as a texture, and to paint the faces or to project it.


The picture appears each time black and I have to modulate its transparency. The shadows disappear under 75%.
And I don't know how the complete transparency with shadows had work one time, but I can't redo it.

>maybe a little more help ? :?
0
User avatar
simon le bon 
 

Re: give shadows to transparent material ??

Postby Al Hart » Mon Aug 24, 2009 2:00 am

simon le bon wrote:Dear Tig,

If you want a '50%' transparent thing to cast a shadow then you need to apply a transparent png texture to the material of the faces, that will cast a shadow even though it's completely transparent - you will need to change its transparency to ~75% to make a shadow BUT it will still appear transparent anyway...

Hum ! It seems to be an excellent tip, but I don't succeed to make it work! :(
I have tried this in several ways: to import the transparent PNG as a picture, as a texture, and to paint the faces or to project it.


You want to use an alpha .PNG file with the transparent channel set to 80% transparency. This will be a solid color image, with the transparency of the entire image set to 80%. Then when you place in SketchUp as a texture, you will make the texture 100% opaque. The 100% opaque will cause SketchUp to cast a shadow from the entire face. The 80% alpha transparency on the .PNG will cause 80% of light to pass through the face.
0
Al Hart
IRender nXt from Render Plus
User avatar
Al Hart 
PluginStore Author
PluginStore Author
 

Re: give shadows to transparent material ??

Postby TIG » Mon Aug 24, 2009 12:33 pm

Simon - no need to import as image etc. Make a new material, edit it and add the png image to it as a texture. Done.

I've attached a working .skm for you... It's in a zip file - simply unzip it into the skm format file and put that file into one of your Material Folders that's listed in you Materials Browser and then you can just use it on faces. It's then in the Model... As Al said you must have the Material's opacity at 70%+ - this one is 100% which is probably best as that will definitely cast a shadow ! I think we have been confusing Opacity and Transparency !

Hope this helps...
TransparentDummy.zip
0
TIG
User avatar
TIG 
Global Moderator
 

Re: give shadows to transparent material ??

Postby Gaieus » Mon Aug 24, 2009 12:56 pm

I think you should be able to attach skm files here (btw since they are zip files actually, a simple "rename" should also work in case you cannot).

I have a transparent material for this purpose only - it's 1 pixel x 1 pixel (so shouldn't overload your system) but keep losing it all the time. Thanks TIG for sharing one again (now I will be too lazy to make my own)
0
User avatar
Gaieus 
 

Re: give shadows to transparent material ??

Postby takesh h » Mon Aug 24, 2009 2:03 pm

Pixero (Jan Sandström) has a Ruby called "JS Shadow Threshold", the explanation goes;
"Set the threshold for a transparent object to cast shadows. Works on either entire model or a selection."
But this plugin never worked in my environment. It might work in some other, though.
http://www.pixero.com/downloads_sketchup.html
0
User avatar
takesh h 
 

Re: give shadows to transparent material ??

Postby Al Hart » Mon Aug 24, 2009 3:14 pm

takesh h wrote:Pixero (Jan Sandström) has a Ruby called "JS Shadow Threshold", the explanation goes;
"Set the threshold for a transparent object to cast shadows. Works on either entire model or a selection."
But this plugin never worked in my environment. It might work in some other, though.


I took a look at this ruby. It uses the opacity setting on a material (0.20 means 80% transparent) and set the "cast shadows" setting on the surface containing the material based on the opacity of a material. This would let you mark items containing material more than 70% opaque (less than 30% transparent as "non shadow casting", but would not do the opposite - make materials less than 70% opaque (more than 30% transparent) cast shadows.

So it would not help with the original problem (in simon's second post): "How to make a 80% transparent (20% opaque) material cast a shadow."
0
Al Hart
IRender nXt from Render Plus
User avatar
Al Hart 
PluginStore Author
PluginStore Author
 

Re: give shadows to transparent material ??

Postby simon le bon » Mon Aug 24, 2009 8:02 pm

Dear Tig and Al Hart, Gaieus and Takesh

Thanks a lot for your help. I still need to understand one or two things:
- like to study Alpha Channel in Photoshop,
- why two different transparent png registered as different materials inteferes,...
- just+a+shadow.png and TransparentDummy.png (1by1 pixel!) react differently.(> see pictures)

> > But the principle is now clear in my mind, and I shall be able to work on it.

Simon - no need to import as image etc. Make a new material, edit it and add the png image to it as a texture. Done.

>>working perfect ! :thumb:

I've attached a working .skm for you...

I appreciate a lot :P :P

(Transparent for Dummy :lol: :lol: )







(I have found this not very far from what we are talking about: Using Images with Alpha Transparency as Components in SketchUp)
______________________________________

And I can now use this tip in my next production: two glasses for the Rum Pitcher ;)



**simon.
0
User avatar
simon le bon 
 

Re: give shadows to transparent material ??

Postby TIG » Mon Aug 24, 2009 10:39 pm

I just realised that TransparentDummy.skm could be taken two ways ! :D
It's "a material that's not really a material at all since you can't see it" ( i.e. 'it's a dummy'): it wasn't meant to be "a transparent material for a dummy" ! BUT as we say in Northern England, "If the cap fits wear it..." ;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: give shadows to transparent material ??

Postby simon le bon » Tue Aug 25, 2009 1:02 am

TIG wrote:"If the cap fits wear it..." ;)


This cap fits very well to me :lol:. I have still a full basket of newbie questions. It seems that the more I learn, the more the boundary of knowledge recedes.

So I have taken your TransparentDummy.skm as a friendly ;) to me. :)



:line: simon.
0
User avatar
simon le bon 
 

Re: give shadows to transparent material ??

Postby TIG » Tue Aug 25, 2009 10:04 am

"If the cap fits wear it..." - said to M. Bonnet*
I hadn't even thought of your surname* when I typed that line !
But I keep putting double meanings into everything I type/say lately - my brain must be splitting in two - that's either multi-tasking or schizophrenia ? ... :roflmao:
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SketchUp Pro & Make Discussions

Who is online

Users browsing this forum: TIG and 11 guests

Visit our sponsors: