Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.22 KB

basic_blending.md

File metadata and controls

37 lines (29 loc) · 1.22 KB

Abstract

물체에 텍스처, 컬러, 라이트를 혼합해보자.

Shader

Shader "UnityShaderTutorial/basic_blend" {
    Properties {
        _MainTex ("Texture to blend", 2D) = ""
    }
    SubShader {
        Tags { "Queue" = "Transparent" }
        Pass {
        	Material {
                Diffuse (1,1,1,1)
                Ambient (1,1,1,1)
            }
            Lighting On

            SetTexture [_MainTex] {
                constantColor (1, 1, 1, 1)
                combine constant lerp(texture) previous
            }
        }
    }
}

Description

fixed-style function command 에서 제공하는 LightingSetTexturecombine을 이용하여 텍스처에 라이트와 컬러를 혼합 할 수 있다.

constantColorcombine에서 사용 할 색상을 설정 할 수 있다. constanceColor의 값은 (Red, Green, Blue, Alpha) 이다. combine 에서 constantColor를 사용하기 위해 constant를 이용한다.

  • Lighting에 관한 자세한 내용은 basic_light를 참고하도록 한다.
  • SetTexure에 관한 자세한 내용은 basic_texture를 참고하도록 한다.