본문 바로가기

랜덤7

[그래픽스] 나만의 필터 만들기 레트로 감성, 노이즈 필터를 만들어보았습니다. 먼저, 필터의 컨셉입니다. 최근 레트로, 복고 등의 열풍이 불면서 인기를 얻은 추억의 물건 중 하나는 바로 필름카메라인데요. 필름카메라의 색감과 빛을 담는 방식이 인기를 얻자, 사람들은 스마트폰과 컴퓨터를 이용해 '마치 필카로 찍은듯한' 보정을 하기 시작했습니다. 각종 필터 어플에서도 레트로 테마가 유행입니다. 레트로 테마 필터의 특징 중 가장 두드러지고, 또 제가 개인적으로 좋아하는 부분은 바로 노이즈, 잡음입니다. 지금 보여드리는 두 사진은 팬들이 레트로 감성으로 보정한 연예인들의 사진입니다. 사진을 자세히 보시면 먼지와 같은 필터가 껴있음을 알 수 있습니다. 이 노이즈는 옛날 카메라의 화질저하 현상을 인위적으로 구현했다고 생각하시면 됩니다. 이번 수업을.. 2022. 2. 8.
[GLSL] Fractal Brownian Motion https://thebookofshaders.com/13/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com float amplitude = 1.; float frequency = 1.; y = sin(x * frequency); float t = 0.01*(-u_time*130.0); y += sin(x*frequency*2.1 + t)*4.5; y += sin(x*frequency*1.72 + t*1.121)*4.0; y += sin(x*frequency*2.221 + t*0.437)*5.0; y += sin(x*freq.. 2022. 1. 6.
[GLSL] Gradient Noise https://thebookofshaders.com/11/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com #ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; // vec2 vec2 random vec2 random(vec2 st){ float x = fract(sin(dot(st*25., vec2(17.34,50.13)))*84239.523); float y = fract(cos(dot(st*25., vec2(28.13,39.49)))*94820.. 2022. 1. 6.
[GLSL] Value Noise https://thebookofshaders.com/11/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com Vec2-float noise. #ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; float random(vec2 st){ float c = fract(sin(dot(st*25., vec2(17.34,50.13)))*84239.523); return c; } float noise(vec2 st){ vec2 i = floor(st); vec2.. 2022. 1. 6.
[GLSL] Float-float Noise https://thebookofshaders.com/11/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com The left side is a noise graph, and the right side is a random graph. A noise and a random are different. Let's make a noise function. float i = floor(x); // integer float f = fract(x); // fraction y = rand(i); float i = floor(x); // i.. 2022. 1. 6.
[GLSL] Maze and Glitch #ifdef GL_ES precision mediump float; #endif #define ROOT2 1.414 uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; float random(float f); float random(vec2 f); float random(vec3 f); float line(vec2 coord, bool dir){ float y; float thc = .2; if(dir){ y = coord.x; }else{ y = 1. - coord.x; } return smoothstep(y-thc, y, coord.y) - smoothstep(y, y+thc, coord.y); } void main(){ ve.. 2022. 1. 6.
[GLSL] Random https://thebookofshaders.com/10/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com Let's write the function 'random' that returns randomed-float data. float random(float st); float random(vec2 st); float random(vec3 st); float random(float f){ float y = fract(sin(f*100.)*100.); return y; } The function 'dot' downgrad.. 2022. 1. 6.