본문 바로가기

생활코딩13

[GLSL] Uniform https://thebookofshaders.com/03/ 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; // Canvas size (width,height) uniform vec2 u_mouse; // mouse position in screen pixels uniform float u_time; // Time in seconds since load void main() { gl_FragCol.. 2022. 1. 5.
[GLSL] Hello World https://thebookofshaders.com/02/ 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 void main() { gl_FragColor = vec4(1.0,0.0,1.0,1.0); } 1. Shader Language is C-flavored language. 2. The final pixel color is assigned to the reserved global variable gl_FragColor. 3. Shader .. 2022. 1. 5.
[GLSL] What is a shader? https://thebookofshaders.com/01/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com Shaders are also a set of instructions, but the instructions are executed all at once for every single pixel on the screen. That means the code you write has to behave differently depending on the position of the pixel on the screen. L.. 2022. 1. 5.
[GLSL] Let's Dive in to the Shader! I wanted to study graphics languages (especially shaders), but I was worried about which language to choose between OpenGL and DirectX. I am currently using a MacBook and would like to use an online tutorial which name is "The Book of Shaders". Furthermore, in fact, GLSL and HLSL are similar to each other except for a few syntax... so I finally decided to study OpenGL shaders. As I mentioned, I .. 2022. 1. 5.