블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2563)N
Unity3D (699)
Programming (461)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (213)
협업 (45)
3DS Max (3)
Game (12)
Utility (133)
Etc (95)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (45)N
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (37)
Thinking (37)
한글 (28)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total1,645,818
Today9
Yesterday509
07-08 01:01

달력

« » 2022.7
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

공지사항

태그목록

반응형

[추가]

[Fixed] iOS: Fixed game objects' colors in light mode. (1379817)

2020.3.27f1 버전에서 해당 이슈가 수정되었다.

 

--------------------------------------------------------------------------------------------------------

Unity 2020.3.21f1에서 Unity 2020.3.22f1으로 업데이트 하고나니 Android는 문제없는데, iOS에서 기존에 발생하지 않던 쉐이더 문제가 생겼다.

 

[증상] 기존에 검은 느낌이던 텍스쳐가 약간 회색빛이 나옴

아래 이미지에서 A이던 느낌이 B느낌이 남

그래서 Unity 2020.3.21f1으로 내리니 다시 정상동작 하는걸 확인했다.

링크 내용을 보니 iOS Dark Mode 관련 버그라고 한다.

 

현재 임시로 해결하는 방법은 iOS Info.plist에서 강제로 Dark Mode로 셋팅 하는 방법이 있다고 한다.

 

버그가 수정될 때까지 Dark Mode로 셋팅하거나, Unity 2020.3.21f1 이하 버전을 사용해야 될 것 같다.

 

 

 

[Unity 소스상에서 Info.plist 수정]

var projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
var plistPath = System.IO.Path.Combine(pathToBuiltProject, "Info.plist");
var plist = new PlistDocument();
plist.ReadFromFile(plistPath);

// [iOS15+Unity2020.3.22f1 이슈] Force Dark Mode(Automatic/Light/Dark) - Appearance
plist.root.SetString("UIUserInterfaceStyle", "Dark");

 

 

 

[Info.plist 수정 참조 링크] https://stackoverflow.com/questions/56537855/is-it-possible-to-opt-out-of-dark-mode-on-ios-13/64015200

 

Is it possible to opt-out of dark mode on iOS 13?

A large part of my app consists of web views to provide functionality not yet available through native implementations. The web team has no plans to implement a dark theme for the website. As such,...

stackoverflow.com

 

 

 

[출처] https://stackoverflow.com/questions/70239569/unity-shader-glitches-according-to-the-dark-mode-on-ios-15

 

Unity shader glitches according to the Dark Mode on iOS 15

I'm using a shader (code below) which allows me to turn an image color into a grayscale (with transparency if needed). Everything was perfect until I updated my device to iOS 15. Since that update,...

stackoverflow.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

출처 : https://qiita.com/kuuki_yomenaio/items/00d74762e930d037ad27

Spine 오브젝트는?

Spine 개체는 Unity에서 말하는 MeshRenderer로 렌더링되고 있습니다. 
(spine-unity의 SkeletonRenderer.cs가 해당 소스입니다) 
즉, MeshRenderer의 Mask 처리를 만들 수 있다면, Mask를 사용할 수 있게 됩니다. 


(왜 이런 엄한 부분을 가지고 예제를 만든 걸까...)

Mask 처리에 대해

요는 Renderer를 Mask하면 되는 것이지만, 
SpriteRenderer 자체를 Mask하는 처리는 Unity에는 없는 것 같습니다. 
그래서, 간단히 자작하기로 했습니다.

Shader로 실제 제작

간단한 것은 역시 스텐실 테스트를 사용하는 것이군요. 
아주 간단하게 설명하면, 스텐실이란 모양을 도려낸다는 의미로 
픽셀 렌더링을 할 때 이 점을 찍는가 찍지 않는다인지를 판정하는 테스트입니다. 
이것을 이용합니다.

Spine 쪽에 적용하는 shader

SpineShader.shader
Shader "Custom/SpineShader"{
Properties
{
        _MainTex ("Base (RGB)", 2D) = "white" {}
}

SubShader
{
        Tags {"Queue"="Transparent+2" "IgnoreProjector"="True" "RenderType"="Transparent"}
        ZWrite Off
        Blend SrcAlpha OneMinusSrcAlpha

        Stencil {
                                Ref 1
                                Comp Equal
        }

        Pass
        {
                CGPROGRAM
                        #pragma vertex vert
                        #pragma fragment frag

                        #include "UnityCG.cginc"

                        struct appdata_t
                        {
                                float4 vertex : POSITION;
                                float2 texcoord : TEXCOORD0;
                        };

                        struct v2f
                        {
                                float4 vertex : SV_POSITION;
                                half2 texcoord : TEXCOORD0;
                        };

                        sampler2D _MainTex;
                        float4 _MainTex_ST;

                        v2f vert (appdata_t v)
                        {
                                v2f o;
                                o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
                                o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
                                return o;
                        }

                        fixed4 frag (v2f i) : COLOR
                        {
                                fixed4 col = tex2D(_MainTex, i.texcoord);
                                return col;
                        }
                ENDCG
        }
}

}

Mask할 Sprite에 설정하는 Shader

SpineSoriteMask.shader
Shader "Custom/SpineSpriteMask"{
Properties
{
        _MainTex ("Base (RGB)", 2D) = "white" {}
}

SubShader
{
        Tags {"Queue"="Transparent+1" "IgnoreProjector"="True"}
        ZWrite Off
        AlphaTest Greater 0.5
        ColorMask 0
        ZTest Always


        Stencil {
                                Ref 1
                                Comp always
                                Pass replace
                        }


        Pass
        {
                CGPROGRAM
                        #pragma vertex vert
                        #pragma fragment frag

                        #include "UnityCG.cginc"

                        struct appdata_t
                        {
                                float4 vertex : POSITION;
                                float2 texcoord : TEXCOORD0;
                        };

                        struct v2f
                        {
                                float4 vertex : SV_POSITION;
                                half2 texcoord : TEXCOORD0;
                        };

                        sampler2D _MainTex;
                        float4 _MainTex_ST;

                        v2f vert (appdata_t v)
                        {
                                v2f o;
                                o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
                                o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
                                return o;
                        }

                        fixed4 frag (v2f i) : COLOR
                        {
                                fixed4 col = tex2D(_MainTex, i.texcoord);
                                if(col.a<0.1)discard;
                                return col;
                        }
                ENDCG
        }
}

}

해설

SpineShader.shader
   Stencil {
             Ref 1
             Comp Equal
   }
SpineSoriteMask.shader
   ColorMask 0
   Stencil {
             Ref 1
             Comp always
             Pass replace
   }

Stencil

해설에 대해서는 
edo_m18 씨의 [Unity] Unity의 Shader 스텐실 버퍼를 시도
를 참고하십시오.

먼저, SpineSpriteMask 입니다만, 
"참조 값 1의 것과 비교하고, 모두 OK로 해서,
참조 값을 버퍼에 기록하고, ColorMask 0 으로 묘화는 하지 않음" 
이 됩니다.

그리고 SpineShader. 
"참조 값은 1, 값의 일치를 체크" 
가 됩니다.

이 설정을 함으로써 
SpineShader 측의 묘화는  StencilTest 를 받게 되고, 
SpineSpriteMask 측에서 설정한 모양대로 도려내지도록 그려집니다.

Unity에서 사용할 때에는 Material화 시킬 필요가 있습니다만, 
그에 대해서는
github
여기를 참고하십시오.

---

* 스파인측 설정

 

* 마스크이미지측 설정

* 매터리얼 설정은 이렇게(특별히 이미지는 지정하지 않고 쉐이더만 넣음)



출처: https://devdata.tistory.com/166 [CH:Windship DevDATA Center]

 

[Unity] Spine 오브젝트를 Mask하기

출처 : https://qiita.com/kuuki_yomenaio/items/00d74762e930d037ad27 Spine 오브젝트는? Spine 개체는 Unity에서 말하는 MeshRenderer로 렌더링되고 있습니다. (spine-unity의 SkeletonRenderer.cs가 해당 소스..

devdata.tistory.com

[참조] https://rainyrizzle.github.io/kr/AdvancedManual/AD_SpriteMask.html

 

Sprite Mask 적용하기

유니티의 "스프라이트 마스크(Sprite Mask)"를 이용하면 다른 Sprite Renderer의 일부를 숨기면서 렌더링을 할 수 있습니다. - 스프라이트 마스크 (유니티 공식 메뉴얼) AnyPortrait에서 제작된 캐릭터들은 S

rainyrizzle.github.io

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형
2019-02-08 update:
Celery is now available for free here!

Here's a toon/cel/anime shader I've been working on that I am redying up for release. It has been designed to be easy for artists to use but also to offer heavy customizability.
I'm making this thread to gauge if there is interest in any particular features, or just general feedback.

The gist of the asset is:
  • Forward-rendered cel-shader with full support for realtime lights + shadows
  • Ramp texture support for custom styles or skin shading
  • Smoothly control the cel-effect with a slider, ranging from "normal" smooth shading to 100% sharp edges
  • Supports a number of effects aimed towards making a material appear to be animated/drawn (specular, rim lighting, cubemap reflections)
  • Supports vertex colors, HSV adjustment with color masking, specular/gloss maps, normal maps, alpha testing, alpha blending (separate material), vertex-displaced outline (integrated in the same material or as a separate shader) as well as some custom ambient lighting
  • Also bundled with the asset is a number of stylized cubemaps useful for toon-like reflections (such as hair reflections or eye glints)
  • Runs well on mobile and plan is to test and make sure it is VR-compatible as well.
Anyway, here are some screenshots:








Currently I am interested in testing it out with more models (as well as gathering some screenshots and feedback). If you've got a smiple-styled model (preferably a character) and you'd like to give it a try, send me a PM with an image of it and I'll send you the asset so you can test it out!

 

 

[출처] forum.unity.com/threads/celery-toon-cel-shader.510330/

 

Celery - Toon/Cel shader

2019-02-08 update: Celery is now available for free here! Here's a toon/cel/anime shader I've been working on that I am redying up for release. It has...

forum.unity.com

 

반응형
Posted by blueasa
TAG cel, SHADER, Unity

댓글을 달아 주세요

[펌] Toon Shader

Unity3D/Shader / 2021. 3. 30. 13:50
반응형

You will learn to write a lit toon shader from scratch. The shader will be lit by a single directional light, and cast and receive shadows.

Toon shading (often called cel shading) is a rendering style designed to make 3D surfaces emulate 2D, flat surfaces. This style entered the mainstream with games like Jet Set Radio and The Wind Waker.

This tutorial will describe step-by-step how to write a toon shader in Unity. The shader will receive light from a single directional source, and have specular reflections and rim lighting. We will use the art style of The Legend of Zelda: Breath of the Wild as our reference, although we will not implement some of the more complex rendering techniques used in the game.

Breath of the Wild divides surfaces into two bands of lightness, adding rim and specular on top. The rim is only applied to surfaces illuminated by the main directional light.

The completed project is provided at the end of the article. Note that it also contains a large amount of comments in the created shader file to aid understanding.

Prerequisites

To complete this tutorial, you will need a working knowledge of Unity engine, and a basic understanding of shader syntax and functionality.

Download starter project .zip

These tutorials are made possible, and kept free and open source, by your support. If you enjoy them, please consider becoming my patron through Patreon.

 

Getting started

Download the starter project provided above and open it in the Unity editor. Open the Main scene, and open the Toon shader in your preferred code editor.

This file contains a simple shader that outputs a sampled texture, tinted by a color (with the default color set to cornflower blue). We will build off this file to create our toon shader.

1. Directional lighting

When writing shaders in Unity that interact with lighting it is common to use Surface Shaders. Surface shaders use code generation to automate the object's interaction with lights and global illumination. However, as our shader will only interact with a single directional light, it will not be necessary to use surface shaders.

We will set up our shader to receive lighting data. Add the following code at the top of the Pass, just after its opening curly brace.

Tags { "LightMode" = "ForwardBase" "PassFlags" = "OnlyDirectional" }

The first line requests some lighting data to be passed into our shader, while the second line further requests to restrict this data to only the main directional light. You can read more about Pass tags here.

To calculate our lighting, we will use a common shading model called Blinn-Phong, and apply some additional filters to give it a toon look. The first step is to calculate the amount of light received by the surface from the main directional light. The amount of light is proportional to the direction, or normal of the surface with respect to the light direction.

Blinn-Phong shading vectors, where L is the vector to the light source and N is the normal of the surface.

We'll need access to the object's normal data within our shader. Add the following code.

// Inside the appdata struct. float3 normal : NORMAL;// Inside the v2f struct. float3 worldNormal : NORMAL;

The normals in appdata are populated automatically, while values in v2f must be manually populated in the vertex shader. As well, we want to transform the normal from object space to world space, as the light's direction is provided in world space. Add the following line to the vertex shader.

o.worldNormal = UnityObjectToWorldNormal(v.normal);

With the world normal now available in the fragment shader, we can compare it to the light's direction using the Dot Product.

The dot product takes in two vectors (of any length) and returns a single number. When the vectors are parallel in the same direction and are unit vectors (vectors of length 1), this number is 1. When they are perpendicular, it returns 0. As you move a vector away from parallel—towards perpendicular—the dot product result will move from 1 to 0 non-linearly. Note that when the angle between the vectors is greater than 90, the dot product will be negative.

Add the following to the fragment shader. Note that existing code that is modified will be highlighted in yellow. New code is not highlighted.

// At the top of the fragment shader. float3 normal = normalize(i.worldNormal); float NdotL = dot(_WorldSpaceLightPos0, normal);// Modify the existing return line. return _Color * sample * NdotL;

This has rendered out a realistic style of illumination. To modify it to be toon-like, we will divide the lighting into two bands: light and dark.

// Below the NdotL declaration. float lightIntensity = NdotL > 0 ? 1 : 0; … return _Color * sample * lightIntensity;

What if we wanted more than two discrete bands of shading?

2. Ambient light

This looks good, but the dark side is too dark; right now it is completely black. Also, the edge between dark and light looks a bit sharp, but we'll deal with that later. For now, we will add ambient light.

Ambient light represents light that bounces off the surfaces of objects in the area and is scattered in the atmosphere. We will model it as a light that affects all surfaces equally and is additive to the main directional light.

// Add as a new property. [HDR] _AmbientColor("Ambient Color", Color) = (0.4,0.4,0.4,1)// Matching variable, add above the fragment shader. float4 _AmbientColor; … return _Color * sample * (_AmbientColor + lightIntensity);

You'll notice that modifying the intensity or color of the Directional Light in the scene does not affect our shader. We will add some code to include this in our lighting calculations.

What does [HDR] mean above the _AmbientColor property?

// Add below the existing #include "UnityCG.cginc" #include "Lighting.cginc"// Add below the lightIntensity declaration. float4 light = lightIntensity * _LightColor0;return _Color * sample * (_AmbientColor + light);

We multiply our existing lightIntensity value and store it in a float4, so that we include the light's color in our calculation. _LightColor0 is the color of the main directional light. It is a fixed4 declared in the Lighting.cginc file, so we include the file above to make use of the value.

Before going further, we'll soften the edge between light and dark to remove the jaggedness. Right now, the transition from light to dark is immediate and occurs over a single pixel. Instead, we'll smoothly blend the value from one to zero, using the smoothstep function.

smoothstep takes in three values: a lower bound, an upper bound and a value expected to be between these two bounds. smoothstep returns a value between 0 and 1 based on how far this third value is between the bounds. (If it is outside the lower or upper bound, smoothstep returns a 0 or 1, respectively).

Comparison between smoothstep (left) and a linear function (right). The values are mapped to the greyscale background, as well as the curves in red.

smoothstep is not linear: as the value moves from 0 to 0.5, it accelerates, and as it moves from 0.5 to 1, it decelerates. This makes it ideal for smoothly blending values, which is how we'll use it to blend our light intensity value.

float lightIntensity = smoothstep(0, 0.01, NdotL);

Our lower and upper bounds, 0 and 0.01, are very close together—this helps maintain a relatively sharp, toony edge. When NdotL is above 0.01 or below 0 it returns one and zero like before, respectively. However, in between that range it will smoothly blend between 0 and 1.

3. Specular reflection

Specular reflection models the individual, distinct reflections made by light sources. This reflection is view dependent, in that it is affected by the angle that the surface is viewed at. We will calculate the world view direction in the vertex shader and pass it into the fragment shader. This is the direction from the current vertex towards the camera.

// Add to the v2f struct. float3 viewDir : TEXCOORD1;// Add to the vertex shader. o.viewDir = WorldSpaceViewDir(v.vertex);

We'll now implement the specular component of Blinn-Phong. This calculation takes in two properties from the surface, a specular color that tints the reflection, and a glossiness that controls the size of the reflection.

// Add as new properties. [HDR] _SpecularColor("Specular Color", Color) = (0.9,0.9,0.9,1) _Glossiness("Glossiness", Float) = 32// Matching variables. float _Glossiness; float4 _SpecularColor;

The strength of the specular reflection is defined in Blinn-Phong as the dot product between the normal of the surface and the half vector. The half vector is a vector between the viewing direction and the light source; we can obtain this by summing those two vectors and normalizing the result.

// Add to the fragment shader, above the line sampling _MainTex. float3 viewDir = normalize(i.viewDir); float3 halfVector = normalize(_WorldSpaceLightPos0 + viewDir); float NdotH = dot(normal, halfVector); float specularIntensity = pow(NdotH * lightIntensity, _Glossiness * _Glossiness);return _Color * sample * (_AmbientColor + light + specularIntensity);

We control the size of the specular reflection using the pow function. We multiply NdotH by lightIntensity to ensure that the reflection is only drawn when the surface is lit. Note that _Glossiness is multiplied by itself to allow smaller values in the material editor to have a larger effect, and make it easier to work with the shader.

Once again we will use smoothstep to toonify the reflection, and multiply the final output by the _SpecularColor.

// Add below the specularIntensity declaration. float specularIntensitySmooth = smoothstep(0.005, 0.01, specularIntensity); float4 specular = specularIntensitySmooth * _SpecularColor;return _Color * sample * (_AmbientColor + light + specular);

4. Rim lighting

Rim lighting is the addition of illumination to the edges of an object to simulate reflected light or backlighting. It is especially useful for toon shaders to help the object's silhouette stand out among the flat shaded surfaces.

The "rim" of an object will be defined as surfaces that are facing away from the camera. We will therefore calculate the rim by taking the dot product of the normal and the view direction, and inverting it.

// In the fragment shader, below the line declaring specular. float4 rimDot = 1 - dot(viewDir, normal);return _Color * sample * (_AmbientColor + light + specular + rimDot);

Once again, we'll toonify the effect by thresholding the value with smoothstep.

// Add as new properties. [HDR] _RimColor("Rim Color", Color) = (1,1,1,1) _RimAmount("Rim Amount", Range(0, 1)) = 0.716// Matching variables. float4 _RimColor; float _RimAmount;// Add below the line declaring rimDot. float rimIntensity = smoothstep(_RimAmount - 0.01, _RimAmount + 0.01, rimDot); float4 rim = rimIntensity * _RimColor;return _Color * sample * (_AmbientColor + light + specular + rim);

With the rim being drawn around the entire object, it tends to resemble an outline more than a lighting effect. We'll modify it to only appear on the illuminated surfaces of the object.

// Add above the existing rimIntensity declaration, replacing it. float rimIntensity = rimDot * NdotL; rimIntensity = smoothstep(_RimAmount - 0.01, _RimAmount + 0.01, rimIntensity);

This is better, but it would be useful to be able to control how far the rim extends along the lit surface. We'll use the pow function to scale the rim.

// Add as a new property. _RimThreshold("Rim Threshold", Range(0, 1)) = 0.1// Matching variable. float _RimThreshold;float rimIntensity = rimDot * pow(NdotL, _RimThreshold);

5. Shadows

As a final step, we will add the ability for our shader to cast and receive shadows. Shadow casting is very simple. Add the following line of code below the entire Pass (outside the curly braces).

// Insert just after the closing curly brace of the existing Pass. UsePass "Legacy Shaders/VertexLit/SHADOWCASTER"

UsePass grabs a pass from a different shader and inserts it into our shader. In this case, we are adding a pass that is used by Unity during the shadow casting step of the rendering process.

In order to receive shadows, we will need to know in the fragment shader whether a surface is in a shadow or not, and factor that in to our illumination calculation. To sample the shadow map cast by a light, we'll need to transfer texture coordinates from the vertex shader to the fragment shader.

// As a new include, below the existing ones. #include "AutoLight.cginc"// Add to the v2f struct. SHADOW_COORDS(2)// Add to the vertex shader. TRANSFER_SHADOW(o)

We include Autolight.cginc, a file that contains several macros we will use to sample shadows. SHADOW_COORDS(2) generates a 4-dimensional value with varying precision (depending on the target platform) and assigns it to the TEXCOORD semantic at the provided index (in our case, 2).

TRANSFER_SHADOW transforms the input vertex's space to the shadow map's space, and then stores it in the SHADOW_COORD we declared.

Before we can sample the shadow map, however, we need to ensure our shader is set up to handle two different lighting cases: when the main directional light does and does not cast shadows. Unity will help us handle these two configurations by compiled multiple variants of this shader for each use case. You can read more about shader variants here. We will use a built-in shortcut to compile our variants. Add the following line of code just below the #pragma fragment frag line.

#pragma multi_compile_fwdbase

This shortcut instructs Unity to compile all variants necessary for forward base rendering. We can now sample the value in the shadow map, and apply it to our lighting calculation.

// In the fragment shader, above the existing lightIntensity declaration. float shadow = SHADOW_ATTENUATION(i); float lightIntensity = smoothstep(0, 0.01, NdotL * shadow);

SHADOW_ATTENUATION is a macro that returns a value between 0 and 1, where 0 indicates no shadow and 1 is fully shadowed. We multiply NdotL by this value, as it is the variable that stores how much light we received from the main directional light.

Conclusion

Toon shaders come in a wide variety of graphical styles, but achieving the effect usually centers around taking a standard lighting setup (as we did with Blinn-Phong) and applying a step function to it. In fact, when normals and lighting data is available it can be done as a post process effect. An example of this can be found in this tutorial for Unreal Engine 4.

View source GitHub repository

Leave me a message

Send me some feedback about the tutorial in the form below. I'll get back to you as soon as I can! You can alternatively message me through Twitter or Reddit.

 

 

[출처] roystan.net/articles/toon-shader.html

 

Unity Toon Shader Tutorial at Roystan

Learn to write a toon shader for Unity engine with specular reflections, rim lighting and shadow casting.

roystan.net

 

반응형
Posted by blueasa
TAG SHADER, toon, Unity

댓글을 달아 주세요

반응형

So I had some spare time to study things I've always wanted to.

Left: Default shader // Right: Blur shader

Note:
All shader files (including the files with number suffix) must be downloaded together.
The numbers represent the clipping panel count when using Soft Clip on UIPanel components.
Refer to: http://www.tasharen.com/forum/index.php?topic=13985.0

 

Unlit - Transparent Colored Blur.shader
0.00MB
Unlit - Transparent Colored Blur 1.shader
0.00MB
Unlit - Transparent Colored Blur 2.shader
0.00MB
Unlit - Transparent Colored Blur 3.shader
0.00MB

 

 

You can customize the amount of blurring by editing the two fields below.
iterations variable represents the radius.
blurSize variable represents the scale (in UV coordinate) which the other pixel should be sampled from.
It should be possible to expose these fields so you can mess around with them through Materials or C# scripts.

half blurSize = 0.005; half iterations = 4;

Limitations:
Originally I wanted to implement a Gaussian Blur effect but it's quite complicated and expensive.
So it ended up in a sort of "hack" by blurring the pixels in horizontal and vertical axis only.
While it may look fine on low iteration count, it doesn't take the diagonal pixels in to calculation, making high radius blurs look unnatural.
I am planning to make another workaround for this issue some time.

 

 

[출처] m.blog.naver.com/reisenmoe/221268044207

 

[Unity, NGUI, Shader] Transparent Colored Blur shader

So I had some spare time to study things I've always wanted to.Note: All shader files (includin...

blog.naver.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

 

https://github.com/sunduk/UnityRoundedShader

 

 

유니티에서 셰이더로 원이나 모서리가 둥근 사각형 만들때 쓸 수 있는 셰이더 입니다.

구글 검색하면 자료는 많이 나오는데 쉽게 이해되는 코드가 없는것 같아서 정리할겸 만들어 봤습니다.

 

UI쪽은 사실 유니티에서 지원하는 mask기능도 있어서 쓸일이 많지는 않겠지만

실시간으로 만든 텍스쳐 다룰때는 유용할것 같습니다.

 

 

p.s 

이거 구현하면서 인터넷과 구글이 없었으면 어떻게 이런 기법들을 배우고 공유할 수 있었을까 하는 생각이 많이 들었습니다.

특히 셰이더토이, 더 북 오브 셰이더 여기 두곳은 정말 보물섬 같은 곳이네요.

 

https://www.shadertoy.com/view/ldfSDj

https://thebookofshaders.com/

 

 

[출처]

게임코디 태풍의그라운드

http://www.gamecodi.com/board/zboard.php?id=GAMECODI_Talkdev&page=1&page_num=35&select_arrange=headnum&desc=asc&sn=off&ss=on&sc=on&keyword=&no=5239&category=

반응형
Posted by blueasa
TAG SHADER, Unity

댓글을 달아 주세요

반응형


참조 : http://blueasa.tistory.com/1777

참조 : http://www.tasharen.com/forum/index.php?topic=10223.0


[파일]

Photoshop Overlay.zip



이전에 포토샵의 Overlay와 비슷한 느낌의 Shader가 필요해서 찾아서 올려놨는데 NGUI 패널에서 클리핑이 안돼서


수정 및 추가해서 올려 놓음.

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

[파일]


$NShader.zip



위 파일 설치하면 됨..



[참조]

Ok. Here's small update:
http://www.jostavo.net/NShader.rar (it's a new fork for 2013 by SilentSouls that uses embedded coloring, the one Nims mentioned before)

I've added support of .shader.compute.cginc (sorry just handling not native support, see attach)

*optional* - in VisualStudio go Tools > Extensions and Updates find NShader and uninstall it, reboot studio (it need to be restarted to remove files)
Make sure Visual Studio is closed

Who afraid to download my file, install one from jostavo.net and then create and add .reg:
For future updates:
{af99cc5c-2a8a-3547-b255-896525bc39d1} - is UUID for current build only!

To find one You needed - open NShader.pkgdef and look for:
Or after install go
There will be yours.
 

Attached Files:




[출처] http://forum.unity3d.com/threads/tutorial-how-to-use-nshader-with-unity-shaders.108995/

반응형
Posted by blueasa

댓글을 달아 주세요

Unity Shader 공부

Unity3D/Shader / 2014. 7. 16. 13:54
반응형

Link : Unity Shader 공부

반응형

'Unity3D > Shader' 카테고리의 다른 글

[NGUI] Unlit - Transparent Colored Additive  (4) 2015.01.27
Unity3d Shader Syntax Highlighting(Visual Studio 2010 또는 2012)  (0) 2014.07.21
Unity Shader 공부  (0) 2014.07.16
Shader Code  (0) 2014.07.16
유니티 셰이더의 기초  (0) 2014.06.28
Unity Shader Reference  (0) 2014.06.24
Posted by blueasa

댓글을 달아 주세요

반응형

링크 : http://usroom.tistory.com/

반응형

'Unity3D > Shader' 카테고리의 다른 글

Rendering Order - Queue tag  (0) 2014.06.24
UnityDiffuseLightmap.shader by jimfleming  (0) 2014.06.23
쉐이더 자료 많은 사이트..  (0) 2014.04.03
Toon/Tf2Shader  (0) 2013.07.19
Toon/Basic with Alpha  (0) 2013.07.19
Toon/Lighted with Alpha  (0) 2013.07.19
Posted by blueasa
TAG SHADER

댓글을 달아 주세요