http://chulin28ho.tistory.com/trackback/230
고급 기능 추가
Toggle
displays a float as a toggle. The property value will be 0 or 1, depending on the toggle state. When it is on, a shader keyword with the uppercase property name +"_ON" will be set, or an explicitly specified shader keyword.
// Will set "_INVERT_ON" shader keyword when set [Toggle] _Invert ("Invert?", Float) = 0
// Will set "ENABLE_FANCY" shader keyword when set [Toggle(ENABLE_FANCY)] _Fancy ("Fancy?", Float) = 0
Enum displays a popup menu for a float property. You can supply either an enum type name (preferably fully qualified with namespaces, in case there are multiple types), or explicit name/value pairs to display. Up to 7 name/value pairs can be specified.
// Blend mode values [Enum(UnityEngine.Rendering.BlendMode)] _Blend ("Blend mode", Float) = 1
// A subset of blend mode values, just "One" (value 1) and "SrcAlpha" (value 5) [Enum(One,1,SrcAlpha,5] _Blend2 ("Blend mode subset", Float) = 1KeywordEnum displays a popup menu for a float property, and enables corresponding shader keyword. This is used with "#pragma multi_compile" in shaders, to enable or disable parts of shader code. Each name will enable "property name" + underscore + "enum name", uppercased, shader keyword. Up to 9 names can be provided.
// Display a popup with None,Add,Multiply choices. // Each option will set _OVERLAY_NONE, _OVERLAY_ADD, _OVERLAY_MULTIPLY shader keywords. [KeywordEnum(None, Add, Multiply)] _Overlay ("Overlay mode", Float) = 0
// ...later on in CGPROGRAM code: #pragma multi_compile _OVERLAY_NONE, _OVERLAY_ADD, _OVERLAY_MULTIPLY // ...PowerSlider displays a slider with a non-linear response for a Range shader property.
// A slider with 3.0 response curve [PowerSlider(3.0)] _Shininess ("Shininess", Range (0.01, 1)) = 0.08When a property drawer class name ends with "Decorator", that is a property decorator, similar to DecoratorDrawer. They are used to create headings and dividers between properties that don't affect the property itself. A single property can have multiple decorators on it. The built-in decorator drawers are: SpaceDecorator, HeaderDecorator.
Space creates vertical space before the shader property.
빈 공간을 만든다. 숫자를 넣으면 더 크게도 된다
// Default small amount of space
[Space] _Prop1 ("Prop1", Float) = 0
// Large amount of space
[Space(50)] _Prop2 ("Prop2", Float) = 0
Header creates a header text before the shader property.
제목을 만든다
[Header(A group of things)] _Prop1 ("Prop1", Float) = 0
아래는 메뉴얼에 있던거 .
[HideInInspector] - does not show the property value in the material inspector.
[NoScaleOffset]
- material inspector will not show texture tiling/offset fields for texture properties with this attribute.[Normal]
- indicates that a texture property expects a normal-map.[HDR]
- indicates that a texture property expects a high-dynamic range (HDR) texture.
'Shader ' 카테고리의 다른 글
커스텀 블렌딩(Custom Blending) / ZWrite Option 만들기 (8) | 2015.11.28 |
---|---|
후처리 이펙트를 만듭시다 ~ 랄랄라 : Make the post effects (0) | 2015.08.13 |
유니티 5.0의 shader (0) | 2015.03.06 |
메쉬를 이용한 유니티 실시간 그림자 (5) | 2015.02.24 |
SilverShader – Introduction to Silverlight and WPF Pixel Shaders (0) | 2015.02.23 |
댓글