정점 애니메이션과 림 라이트를 조합하면 좋은 느낌이었다
소개
내 생각에 따라 여러 가지 놀 수있는 표현이었기 때문에 시어
안심과 신뢰의 Made With Unity
셰이더
제목대로 간단한 정점 애니메이션과 림 라이트를 가산 합성해 버리는 셰이더입니다
Camera의 ClearFlags를 Skybox로 하면 비치지 않게 되어 버리는 (뭔가 이상하다) 때문에 SolidColor로 해 주세요

Albedo라든지 Alpha에 아무것도 넣지 않기 때문인가...?
Yurayura.shaderShader "Custom/Yurayura"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Color("Color", Color) = (1, 1, 1, 1)
_Amplitude("Amplitude", float) = 1.0
_RimPower("RimPower", Range(0.1, 10.0)) = 3.0
}
SubShader
{
Tags{ "RenderType"="Transparent" "Queue"="Transparent" }
Blend One One
Cull Back
ZWrite Off
CGPROGRAM
#pragma surface surf Lambert vertex:vert
#pragma target 3.0
#include "Noise.cginc"
sampler2D _MainTex;
float _Amplitude;
float4 _Color;
half _RimPower;
struct Input
{
float2 uv_MainTex;
float3 viewDir;
};
void vert(inout appdata_full v)
{
v.vertex.xyz += v.normal * _Amplitude * perlin(v.vertex.xyz * _Time.y);
}
void surf(Input IN, inout SurfaceOutput o)
{
float rim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal));
float3 rimColor = pow(rim, _RimPower);
o.Emission = tex2D(_MainTex, IN.uv_MainTex).rgb * rimColor * _Color;
}
ENDCG
}
Fallback "Diffuse"
}
Noise.cgincfloat rand(float2 co)
{
return frac(sin(dot(co.xy, float2(12.9898, 78.233))) * 43758.5453);
}
float rand(float3 co)
{
return frac(sin(dot(co.xyz, float3(12.9898, 78.233, 56.787))) * 43758.5453);
}
float noise(float3 pos)
{
float3 ip = floor(pos);
float3 fp = smoothstep(0, 1, frac(pos));
float4 a = float4(
rand(ip + float3(0, 0, 0)),
rand(ip + float3(1, 0, 0)),
rand(ip + float3(0, 1, 0)),
rand(ip + float3(1, 1, 0)));
float4 b = float4(
rand(ip + float3(0, 0, 1)),
rand(ip + float3(1, 0, 1)),
rand(ip + float3(0, 1, 1)),
rand(ip + float3(1, 1, 1)));
a = lerp(a, b, fp.z);
a.xy = lerp(a.xy, a.zw, fp.y);
return lerp(a.x, a.y, fp.x);
}
float perlin(float3 pos) {
return (noise(pos) * 32 +
noise(pos * 2 ) * 16 +
noise(pos * 4) * 8 +
noise(pos * 8) * 4 +
noise(pos * 16) * 2 +
noise(pos * 32) ) / 63;
}
Noise 같은 함수군은 cginc에 정리해 버리면 편리하네요
우선 스피어에 페타하면 이런 느낌이 든다

움직이는 것도 ◯와 공처럼 되었습니다만, 조금 맛이 없기 때문에 조금 조정해 드리겠습니다

Material을 이렇게 하면

상당히 귀여워졌습니다.
이렇게 할 수 있습니다.
불꽃의 고리 같은


Sphere를 3개 겹쳐 각각 Rotation만 즐겁게 해주면 이런 느낌이 된다
결정처럼


Amplitude를 부의 값으로 하면 이런 느낌이 듭니다.
적당히 텍스처 넣어 보자


Sphere2 겹쳐서. 다채로운 텍스처를 넣으면 활기차다.
믿을 수 있니? 이것 전부 스피어야...

PostProcessingStack 자산을 넣고 Bloom을 넣으면 더 깨끗해질 것 같습니다.
Reference
이 문제에 관하여(정점 애니메이션과 림 라이트를 조합하면 좋은 느낌이었다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/Ryopon/items/54b9d4649d8ac16f844f
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
제목대로 간단한 정점 애니메이션과 림 라이트를 가산 합성해 버리는 셰이더입니다
Camera의 ClearFlags를 Skybox로 하면 비치지 않게 되어 버리는 (뭔가 이상하다) 때문에 SolidColor로 해 주세요

Albedo라든지 Alpha에 아무것도 넣지 않기 때문인가...?
Yurayura.shader
Shader "Custom/Yurayura"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Color("Color", Color) = (1, 1, 1, 1)
_Amplitude("Amplitude", float) = 1.0
_RimPower("RimPower", Range(0.1, 10.0)) = 3.0
}
SubShader
{
Tags{ "RenderType"="Transparent" "Queue"="Transparent" }
Blend One One
Cull Back
ZWrite Off
CGPROGRAM
#pragma surface surf Lambert vertex:vert
#pragma target 3.0
#include "Noise.cginc"
sampler2D _MainTex;
float _Amplitude;
float4 _Color;
half _RimPower;
struct Input
{
float2 uv_MainTex;
float3 viewDir;
};
void vert(inout appdata_full v)
{
v.vertex.xyz += v.normal * _Amplitude * perlin(v.vertex.xyz * _Time.y);
}
void surf(Input IN, inout SurfaceOutput o)
{
float rim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal));
float3 rimColor = pow(rim, _RimPower);
o.Emission = tex2D(_MainTex, IN.uv_MainTex).rgb * rimColor * _Color;
}
ENDCG
}
Fallback "Diffuse"
}
Noise.cginc
float rand(float2 co)
{
return frac(sin(dot(co.xy, float2(12.9898, 78.233))) * 43758.5453);
}
float rand(float3 co)
{
return frac(sin(dot(co.xyz, float3(12.9898, 78.233, 56.787))) * 43758.5453);
}
float noise(float3 pos)
{
float3 ip = floor(pos);
float3 fp = smoothstep(0, 1, frac(pos));
float4 a = float4(
rand(ip + float3(0, 0, 0)),
rand(ip + float3(1, 0, 0)),
rand(ip + float3(0, 1, 0)),
rand(ip + float3(1, 1, 0)));
float4 b = float4(
rand(ip + float3(0, 0, 1)),
rand(ip + float3(1, 0, 1)),
rand(ip + float3(0, 1, 1)),
rand(ip + float3(1, 1, 1)));
a = lerp(a, b, fp.z);
a.xy = lerp(a.xy, a.zw, fp.y);
return lerp(a.x, a.y, fp.x);
}
float perlin(float3 pos) {
return (noise(pos) * 32 +
noise(pos * 2 ) * 16 +
noise(pos * 4) * 8 +
noise(pos * 8) * 4 +
noise(pos * 16) * 2 +
noise(pos * 32) ) / 63;
}
Noise 같은 함수군은 cginc에 정리해 버리면 편리하네요
우선 스피어에 페타하면 이런 느낌이 든다

움직이는 것도 ◯와 공처럼 되었습니다만, 조금 맛이 없기 때문에 조금 조정해 드리겠습니다

Material을 이렇게 하면

상당히 귀여워졌습니다.
이렇게 할 수 있습니다.
불꽃의 고리 같은


Sphere를 3개 겹쳐 각각 Rotation만 즐겁게 해주면 이런 느낌이 된다
결정처럼


Amplitude를 부의 값으로 하면 이런 느낌이 듭니다.
적당히 텍스처 넣어 보자


Sphere2 겹쳐서. 다채로운 텍스처를 넣으면 활기차다.
믿을 수 있니? 이것 전부 스피어야...

PostProcessingStack 자산을 넣고 Bloom을 넣으면 더 깨끗해질 것 같습니다.
Reference
이 문제에 관하여(정점 애니메이션과 림 라이트를 조합하면 좋은 느낌이었다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/Ryopon/items/54b9d4649d8ac16f844f
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

PostProcessingStack 자산을 넣고 Bloom을 넣으면 더 깨끗해질 것 같습니다.
Reference
이 문제에 관하여(정점 애니메이션과 림 라이트를 조합하면 좋은 느낌이었다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/Ryopon/items/54b9d4649d8ac16f844f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)