상세 컨텐츠

본문 제목

[Unity] 유니티 머테리얼, 쉐이더 관련

게임엔진관련/유니티 엔진

by AlrepondTech 2019. 8. 6. 12:22

본문

반응형

 

 

 

 

=================================

=================================

=================================

 

 

 

 

 

 

 

 

출처: https://blueasa.tistory.com/868

 

... 

string shaderName = "Mobile/Unlit (Supports Lightmap)";

GameObject sampleObject;

...

 

MeshRenderer mr = sampleObject.GetComponent<MeshRenderer>();   // 일단 MeshRenderer 컴포넌트를 얻고

mr.material.shader = Shader.Find(shaderName);                                 // 쉐이더를 찾아(이름으로) 변경

 

 

<출처> http://unity3d.com/support/documentation/ScriptReference/Material-shader.html

 

출처 : http://blog.naver.com/kzh8055/140158747595

 

 

 

=================================

=================================

=================================

 

 

 

출처: https://selfishred.tistory.com/entry/Unity3DMaterial-Shader-%EB%B3%80%EA%B2%BD

 

public Shader m_shdVertexColor = Shader.Find ( "Transparent/Vertex Colored" );
public Shader m_shdAlphaBlended = Shader.Find( "Mobile/Particles/Alpha Blended" );
 
public GameObject m_objImage;
 
private bool bChange = false;
 
void Awake()
{
    if( bChange )
        m_objImage.renderer.material.shader = m_shdVertexColor;
    else
        m_objImage.renderer.material.shader = m_shdAlphaBlended;
}


출처: https://selfishred.tistory.com/entry/Unity3DMaterial-Shader-변경 [SelfishREd]

 

 

 

 

 

반응형

 

 

728x90

 

 

 

 

 

=================================

=================================

=================================

 

 

 

출처: https://m.blog.naver.com/PostView.nhn?blogId=kzh8055&logNo=140158747595&proxyReferer=https%3A%2F%2Fwww.google.com%2F

 

... 

string shaderName = "Mobile/Unlit (Supports Lightmap)";

GameObject sampleObject;

...

 

MeshRenderer mr = sampleObject.GetComponent<MeshRenderer>();   // 일단 MeshRenderer 컴포넌트를 얻고

mr.material.shader = Shader.Find(shaderName);                                 // 쉐이더를 찾아(이름으로) 변경

 

<출처> http://unity3d.com/support/documentation/ScriptReference/Material-shader.html

 

 

 

 

=================================

=================================

=================================

 

 

 

*기타관련링크

https://ordinarybk.tistory.com/entry/Unity3D-renderermaterial-%EA%B3%BC-renderersharedMaterial%EC%9D%98-%EC%B0%A8%EC%9D%B4%EC%A0%90

 

https://www.sysnet.pe.kr/Default.aspx?mode=2&sub=0&pageno=0&detail=1&wid=11607

 

 

 

=================================

=================================

=================================

 

 

반응형


관련글 더보기

댓글 영역