본문 바로가기

오픈지엘27

[GLSL] Smoothstep https://thebookofshaders.com/05/ 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; uniform vec2 u_mouse; uniform float u_time; void main() { vec2 st = gl_FragCoord.xy/u_resolution; float y = st.x; vec3 color = vec3(y); gl_FragColor = vec4(color,1.. 2022. 1. 5.
[GLSL] Fragment Coordinate (gl_FragCoord) https://thebookofshaders.com/03/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com In the same way GLSL gives us a default output, vec4 gl_FragColor, it also gives us a default input, vec4 gl_FragCoord, which holds the screen coordinates of the pixel or screen fragment that the active thread is working on. With vec4 .. 2022. 1. 5.
[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.
[그래픽스] 정점으로 개체 그리기, 애니메이팅, 모듈화 * Computer Graphics Programming in OpenGL with C++ 책을 참고하였습니다. * 책을 번역한 것이 아닌, 제가 독학 후 책을 참고하여 설명하는 게시물입니다. 따라서 책에 없는 부연 설명이 있기도 하며, 의역 또는 오역, 오개념이 있을 수 있습니다. 피드백은 댓글을 남겨주세요. * 영어 용어를 최대한 한국어로 번역하지 않습니다. 처음부터 코드에서 사용되는, 또는 원서나 인터넷에서 사용되는 보편적 용어를 사용하여 개념을 잡는 것을 추천드립니다. ​ ​ 궁극적으로 우리는 보통 하나 이상의 정점을 활용해 개체를 생성하는 것을 목표로 합니다. 따라서 우선은 3개의 정점으로 삼각형을 그리는 간단한 예제부터 실행해보도록 하죠. ​ 지난 [Program 2.2]를 약간만 수정하면 됩.. 2020. 6. 9.
[그래픽스] 파일에서 GLSL 소스코드 읽기 * Computer Graphics Programming in OpenGL with C++ 책을 참고하였습니다. * 책을 번역한 것이 아닌, 제가 독학 후 책을 참고하여 설명하는 게시물입니다. 따라서 책에 없는 부연 설명이 있기도 하며, 의역 또는 오역, 오개념이 있을 수 있습니다. 피드백은 댓글을 남겨주세요. * 영어 용어를 최대한 한국어로 번역하지 않습니다. 처음부터 코드에서 사용되는, 또는 원서나 인터넷에서 사용되는 보편적 용어를 사용하여 개념을 잡는 것을 추천드립니다. ​ ​ 지난 '쉐이더' 게시글(https://goeden.tistory.com/10)에서 살펴본 [Program 2.2]는 쉐이더 코드가 main.cpp 안에 문자열로 존재했습니다. 하지만 쉐이더 코드를 따로 파일로 저장하여, ma.. 2020. 6. 8.
[그래픽스] 컴퓨터 그래픽스 프로그래밍 개발 환경 구축 (Windows, MacOS) 그래픽스 교재 구매 링크 (원서) Windows OpenGL 개발환경 구축 MacOS OpenGL 개발환경 구축 + 이 교재에서 요구하는 texture mapping을 정확하게 수행하기 위해서는, 윈도우 환경에서 학습하실 것을 추천합니다. Computer Graphics Programming in Opengl Using C++ 책으로 만나는 새로운 세상 book.naver.com "Computer Graphics Programming in OpenGL with C++"라는 위 교재로 공부 후 업로드합니다. 현재까지 번역본이 없어 원서로 학습 후 한글로 업로드할 예정입니다. Windows 환경 구축 MacOS 개발 환경의 한계를 느껴 데스크탑을 맞췄습니다. Windows 에서 다시 개발 환경을 구축해봅시다.. 2020. 5. 22.