| View previous topic :: View next topic |
p3x797
Joined: 30 Mar 2009 Posts: 6
|
Posted: Fri Apr 24, 2009 4:51 pm Post subject: Double Sided *Material* |
|
|
|
Hi everyone!
I really need to be able to create a double sided material.
For example one face (two tris, 1 poly) that shows the material on the reverse side of it.
I know alot of people have enquired about this, but i really can't afford to physically have the reverse side as part of the geometry.
My actual question is, does unity support this type of material option and if so does it need to be scripted in or is there a prefab or a shader that someone has made that is able to do it
Any info regarding this would be amazing!
Many thanks |
|
| Back to top |
|
|
Eric5h5
Joined: 19 Jul 2006 Posts: 10865
|
Posted: Fri Apr 24, 2009 9:35 pm Post subject: Re: Double Sided *Material* |
|
|
|
This has been asked and answered many times...a search will easily find the solution.
--Eric |
|
| Back to top |
|
|
Daniel Brauer
Joined: 11 Aug 2006 Posts: 1554 Location: GMA950
|
|
| Back to top |
|
|
p3x797
Joined: 30 Mar 2009 Posts: 6
|
Posted: Fri Apr 24, 2009 9:49 pm Post subject: |
|
|
|
Hi eric
Thank you for your insightful response, maybe if i had spent time making four thousand and something posts i may recall a vague reference to it, but unfortunately i have just the two posts for now.
I have looked alot using the search and all i can find is information from people that don't really seem to actually know the answer to my specific question and just describe physically making another polygon mirrored fr the solution to a two sided *material*.
i.e.
"I know alot of people have enquired about this, but i really can't afford to physically have the reverse side as part of the geometry."
if you can find a post relating to the material settings i need to use that can answer my question, you may receive a gold star.
or
you may not
either way don't make condescending posts for the sake of it, its slightly immature, and will waste a lot of your time. Much appreciated.
But to anyone else that may be able to help, i would love some constructive feedback it will help alot as i really can not find any information relating to this and i felt posting a more specific question would be more efficient.
Many thanks
Kind regards |
|
| Back to top |
|
|
p3x797
Joined: 30 Mar 2009 Posts: 6
|
Posted: Fri Apr 24, 2009 9:50 pm Post subject: Ta much! |
|
|
|
Hi Muriac,
Thank you very very much! ill look into that then, i wasn't sure on what avenue to approach on this. But this will really help.
Thanks so much! |
|
| Back to top |
|
|
Eric5h5
Joined: 19 Jul 2006 Posts: 10865
|
Posted: Fri Apr 24, 2009 10:15 pm Post subject: Re: Ta much! |
|
|
|
My post was not condescending, it was factual. If you do a search on "double-sided", you get many relevant results. This is to your benefit, since you would have instantly gotten your answer without having to wait for a reply. Please refrain from reading negative intent into posts where there isn't any.
--Eric |
|
| Back to top |
|
|
Charles Hinshaw Unity Graphic Designer
Joined: 06 Feb 2008 Posts: 1071 Location: Indianapolis, IN
|
Posted: Fri Apr 24, 2009 10:19 pm Post subject: |
|
|
|
I don't think Eric's response was inappropriate -- this really has been asked before. And that comes up through searching. _________________ Charles Hinshaw |
|
| Back to top |
|
|
Animaleante
Joined: 03 Apr 2009 Posts: 26 Location: Curitiba - Brazil
|
Posted: Fri Apr 24, 2009 11:25 pm Post subject: |
|
|
|
Here am I, a complete newb, having to answer such a popular question, shame on you!!! jk
here is my code for a DoubleSided Shader mate. Not like the ones Eric posted, this one is for any model, lighted or not:
| Code: | Shader "DoubleSided" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
//_BumpMap ("Bump (RGB) Illumin (A)", 2D) = "bump" {}
}
SubShader {
//UsePass "Self-Illumin/VertexLit/BASE"
//UsePass "Bumped Diffuse/PPL"
// Ambient pass
Pass {
Name "BASE"
Tags {"LightMode" = "PixelOrNone"}
Color [_PPLAmbient]
SetTexture [_BumpMap] {
constantColor (.5,.5,.5)
combine constant lerp (texture) previous
}
SetTexture [_MainTex] {
constantColor [_Color]
Combine texture * previous DOUBLE, texture*constant
}
}
// Vertex lights
Pass {
Name "BASE"
Tags {"LightMode" = "Vertex"}
Material {
Diffuse [_Color]
Emission [_PPLAmbient]
Shininess [_Shininess]
Specular [_SpecColor]
}
SeparateSpecular On
Lighting On
Cull Off
SetTexture [_BumpMap] {
constantColor (.5,.5,.5)
combine constant lerp (texture) previous
}
SetTexture [_MainTex] {
Combine texture * previous DOUBLE, texture*primary
}
}
}
FallBack "Diffuse", 1
} |
[/code] |
|
| Back to top |
|
|
p3x797
Joined: 30 Mar 2009 Posts: 6
|
Posted: Sat Apr 25, 2009 11:35 am Post subject: |
|
|
|
| Thanks guys :D |
|
| Back to top |
|
|
Hanford

Joined: 28 Aug 2008 Posts: 154 Location: Mountain View, CA
|
Posted: Sat May 02, 2009 9:02 pm Post subject: |
|
|
|
| This gets asked/answered so often, i think it's worth Unity looking into providing this functionality with the standard assets package. |
|
| Back to top |
|
|
Hanford

Joined: 28 Aug 2008 Posts: 154 Location: Mountain View, CA
|
Posted: Sat May 02, 2009 9:15 pm Post subject: |
|
|
|
PS: What part of that shader code actually renders it double-sided?
I wish more shader source had comments in them; I feel lost trying to figure it out. |
|
| Back to top |
|
|
Animaleante
Joined: 03 Apr 2009 Posts: 26 Location: Curitiba - Brazil
|
Posted: Sat May 02, 2009 9:17 pm Post subject: |
|
|
|
...SeparateSpecular On
Lighting On
Cull Off
...
Just the cull off part |
|
| Back to top |
|
|
Hanford

Joined: 28 Aug 2008 Posts: 154 Location: Mountain View, CA
|
Posted: Mon May 04, 2009 1:21 am Post subject: |
|
|
|
| Animaleante wrote: | ...SeparateSpecular On
Lighting On
Cull Off
...
Just the cull off part |
Wow, so you can take any shader with Cull off, remove that line, and you get double-sided?
Seems like comments in the default shader code could cut down this problem being asked/answered so often. |
|
| Back to top |
|
|
Animaleante
Joined: 03 Apr 2009 Posts: 26 Location: Curitiba - Brazil
|
Posted: Mon May 04, 2009 12:59 pm Post subject: |
|
|
|
| Hanford wrote: | | Animaleante wrote: | ...SeparateSpecular On
Lighting On
Cull Off
...
Just the cull off part |
Wow, so you can take any shader with Cull off, remove that line, and you get double-sided?
Seems like comments in the default shader code could cut down this problem being asked/answered so often. |
Actually, is not taking that line off. It is more like:
Cull On //Don't render "inner" faces
Cull Off // Render double-sided |
|
| Back to top |
|
|
GI_JOEJK

Joined: 11 Nov 2008 Posts: 80 Location: Sacramento, CA
|
Posted: Wed May 06, 2009 9:33 am Post subject: |
|
|
|
| Animaleante wrote: | ...SeparateSpecular On
Lighting On
Cull Off
...
Just the cull off part |
It would be EXTREMELY helpful to have a simple "on/off" button next to the shader for this function...
This is giving me shades of TGEA nauseum. |
|
| Back to top |
|
|