마법적 구슬형태 제작



마법적 구슬형태 제작

금별 0 2,018 2019.08.30 06:32

 

I guess this is the first entry to this category, since I never had such a demand for a write-up before. So here goes!

The different between this format and regular “My take on shaders” post is that this is a more direct format, just going through a particular effect that I find too specific to write a complete tutorial about. Also, in some cases, like this one, I won’t be providing the completed code but I will be writing about the general idea and the process behind the specific effect.

In my tweet I mentioned it being a form of “raymarching” though I might be using the term loosely here. While I use a loop to move towards a certain direction, the technique doesn’t really resemble traditional raymarching. So keep that in mind.

 

The core idea

 

I’ve been constantly thinking about how to take advantage of past effects, and in this case I had an idea concerning the “layered parallax” effect that I demonstrated in an older post.

With that technique, you could sample a texture using coordinates that had been offset “inwards” of the object, by using the camera’s view direction in tangent space. The effect is super useful for adding some depth to materials like ice, or tiles or basically anything you want to make it look like “there’s something underneath the surface”. The result looked something like this:

 

 

My thoughts going from this effect were these:

  • Let’s ditch the main texture, don’t need it for now
  • What if in every “layer” of this effect, I performed a “step” function on a 2D noise texture, where the cutoff value ranges from 0 to 1 based on the “index” of the layer?

The “stepping” (that’s what I’ll call “using the “step” function” from now on) was inspired by the concept of using grayscale textures as heightmaps, with their value representing depth. Adjusting the cutoff value of a simple texture with a radial gradient looks like this:

 

As if the texture actually represents a cone and when I’m using “step” I’m cutting slices into it which decrease in size as I get to the top. Basically I’m super-over-explaining SDFs here, but that representation really helped clear things in my head.

So, if I were to assign 1 to the cutoff value of the out-most layer, 0 to the value of the deepest layer and the inbetween values to the inbetween layers, each parallax layer would have a differently sized “slice” of the texture.

If we add that “stepping” to each layer, with the same radial gradient texture, we end up with something like this (the texture is tiled 5 times so just pay attention to the middle one):

 

This uses 10 iterations on the grayscale texture

Turn up the iterations/number of layers (here it’s something 128) and you have smoothness:

 

Add a somewhat more complex texture, like a simple cloud texture and you have this:

 

 

Trying out random textures and noises is super fun with this one btw.

Add the material on a sphere and you have the ORB:

 

 

Add 2 HDR colors, and lerp between them based on the layer “index” instead of just lerping the intensity from 0 to 1 (also some Post-processing for the looks):

 

 

Add some waving displacement when sampling the texture in each layer for some extra variation and *magic*:

 

 

And that’s it! I hope that was helpful and I hope there will be many more write-ups in the future, especially as I’m easing into VFX stuff at the moment of writing. So, I’ll see you in the next one! ????



 

These posts will never go behind a paywall. But if you really really super enjoyed this post, consider buying me a coffee, or becoming my patron to get exciting benefits!

 

Comments


번호 포토 분류 제목 글쓴이 날짜 조회
258 유니티 유니티 이펙트 튜토리얼 - 그라운드크랙 뎁스 마스크쉐이더 튜토리얼 금별 2019.03.20 5410
257 유니티 유니티 이펙트 - 발사체 참고영상외 + 팁 금별 2019.05.09 4882
256 유니티 유니티 반응형 풀 쉐이더 만들기 댓글+1 금별 2019.07.09 2660
255 유니티 유니티 - 홀로그램 행성 쉐이더 댓글+1 금별 2019.07.09 2079
254 유니티 유니티 - Soft squish shader(부드럽게 찌그러지는) 댓글+1 금별 2019.07.09 3162
253 유니티 유니티 쉐이더 튜토리얼 - 포트나이트형 갤럭시 쉐이더 제작 금별 2019.07.09 1849
252 유니티 유니티 쉐이더 팁 - 스크린스페이스 맵핑을 객체의 월드포지션에 고정시키는 방법을 찾기 위한 사소한 팁 금별 2019.07.14 2007
251 유니티 유니티 쉐이더 팁 - 버블 쉐이더 만들기 금별 2019.07.14 4350
250 유니티 [NDC 2018] 게임 이펙트를 시작하는 법 금별 2019.07.18 1678
249 유니티 유니티 쉐이더 팁 - RzFX//Radar Scan World Grid 금별 2019.07.24 4179
248 유니티 유니티 쉐이더 팁 - 유령 트레일효과 SIN WAVE TRAIL 금별 2019.08.02 5881
247 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 1 댓글+1 금별 2019.08.12 2180
246 유니티 유니티 쉐이더 그래프 - Weaving Ring Tutorial 2 댓글+1 금별 2019.08.12 1710
245 유니티 유니티 쉐이더 - 쉐이더그래프/앰플리파이 쉐이더에서의 커스터 버택스 스트림 사용 금별 2019.08.20 5286
244 유니티 Skeleton Mage Summon With Shaders and Textures 금별 2019.08.20 1445
243 유니티 유니티 버텍스 옵셋 효과 예제 Juane Gray 금별 2019.08.20 1712
열람중 유니티 마법적 구슬형태 제작 금별 2019.08.30 2019
241 유니티 유니티 이펙트 제작과정 - 사슬로 감싼 폭발형태 제작 금별 2019.08.30 4899
240 유니티 유니티 - 원통형 메쉬에 토네이도형 uv 흐름제어 금별 2019.08.30 1899
239 유니티 유니티 - Stylized 폭포 제작하기 금별 2019.09.07 8816
238 유니티 유니티 - 포탈이펙트 예제와 제작과정 금별 2019.09.09 5950
237 유니티 유니티 이펙트 팁 - 포털제작 금별 2019.10.19 5010

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand