Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity - how to make material double sided

Tags:

unity3d

Search for the issue gives a number of solutions, but they don't work for some reason in mine Unity3D 5.4. Like camera inside a sphere

I do not see cull and/or sides in material in Unity editor. In C#

rend = GetComponent<Renderer>();
mater = rend.material;
rend.setFaceCulling( "front", "ccw" );
mater.side = THREE.DoubleSide;

gives no such setFaceCulling and side property.

How to make material double sided?

like image 781
Alexei Martianov Avatar asked Feb 15 '17 15:02

Alexei Martianov


People also ask

What is shader graph unity?

Shader Graph lets you visually author shaders and see the results in real-time. This node-based system opens up the field for artists and other team members – simply connect nodes in a graph network. Shader Graph solutions. Streamline your workflow by creating high-quality shaders.

What is a material unity?

What is a material? In Unity (and in many 3D modelling aspects), a Material is a file that contains information about the lighting of an object with that material. Notice how a gray sphere denotes the material, with some light coming in from the top.


2 Answers

Maybe my answer for your Unity Version doesn't work, but here it is a solution for newer versions in HDRP in image below
enter image description here

like image 107
ssmasrour Avatar answered Oct 26 '22 00:10

ssmasrour


Use or create a shader with

Cull off

Seen here in this simple 2 sided shader:

Shader "Custom/NewSurfaceShader" {
    Properties {
        
    }
    SubShader {
         Cull off   
         Pass {
             ColorMaterial AmbientAndDiffuse
         }
        
    }
}
like image 36
PedPak Avatar answered Oct 26 '22 00:10

PedPak