Get it on Google Play


Wm뮤 :: 유니티 쉐이더 기초

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
퇴직한 전자과 게임프로그래머
2020.3.48f1 , 2022.3.6f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


2021. 4. 17. 19:41 Unity/shader

유니티 셰이더는 HLSL임

 

 

 

실수형

 

float

-고정밀 

-32비트

 

half

-중정밀

-16비트

-범위 : -60,000 ~ +60,000

-정밀도 : 십진숫자 약 3개

 

fixed

-저정밀

-11비트

-범위 : -2.0 ~ +2.0

-정밀도 : 1/256

 

 

 

정수형

int

 

 

 

fixed4 타입 선언

 

fixed4 col = fixed4(0,0,0,0);

 

 

전부 잘 작동

for

break

switch

continue

 

 

 

 

 

 

 

 

Fixed Function Shader 샘플

Shader "Ahzkwid/UnlitCullFont" {
    Properties {
        _MainTex ("MainTex", 2D) = "white" {}
        _Color ("Main Color", Color) = (1,1,1,0)
        _Stencil_Ref ("Stencil_Ref", int) = 1
    }
    SubShader {
        Tags { 
        "RenderType"="Opaque" 
        "Queue"="Geometry+3000"
        }

        Cull front
        //ZTest Always

        Pass{
        	blend srcalpha oneminussrcalpha
	        SetTexture [_MainTex] 
	        {
	        	ConstantColor [_Color]
	        	//Combine texture
	        	//Combine texture lerp(texture) constant
                //Combine texture* primary DOUBLE, texture* constant
                Combine texture* primary
                Combine previous* constant
	        }

        }

    } 
}

 

 

 

 

 

'Unity > shader' 카테고리의 다른 글

Depth 쉐이더  (0) 2021.06.12
유니티 쉐이더 게임 관련  (0) 2021.04.17
모션블러 종류  (1) 2021.03.02
posted by 모카쨩

  • total
  • today
  • yesterday

Recent Post

저사양 유저용 블로그 진입