본문 바로가기

그래픽스35

[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.
[컴퓨터그래픽스] 키보드 마우스 입력을 통한 화면 변경 #include #include #include #define PI 3.141592 #define CCW 0 #define CW 1 using namespace glm; vec3 my_triangle1[3] = { vec3(-10.f, 0.f, 0.f), vec3(10.f, 0.f, 0.f), vec3(0.f, 10.f, 0.f) }; // CCW vec3 my_triangle2[3] = { vec3(10.f, 0.f, 0.f), vec3(-10.f, 0.f, 0.f), vec3(0.f, 10.f, 0.f) }; // CW vec3 faceNorm[2]; vec3 eyeVec; GLfloat angle[2]; GLint culling = 3; // nothing first GLint isTriangle1.. 2021. 4. 3.
[컴퓨터그래픽스] 소용돌이 실습 (함수 사용하지 않기) void RenderScene(void) { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); GLfloat rotation[16] = { cos(30.0), 0, -sin(30.0), 0, 0, 1, 0, 0, sin(30.0), 0, cos(30.0), 0, 0, 0, 0, 1 }; GLfloat translation[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, -0.1, 0, 1 }; glPushMatrix(); glColor3f(0.5f, 0.5f, 0.5f); glPointSize(3); glBegin(GL_POINTS); glVertex4f(0.25f, 0.8f, 0.0f, 1.0f); glEnd();.. 2021. 4. 3.
AlphaFold deepmind.com/blog/article/alphafold-a-solution-to-a-50-year-old-grand-challenge-in-biology AlphaFold: a solution to a 50-year-old grand challenge in biology In a major scientific advance, the latest version of our AI system AlphaFold has been recognised as a solution to this grand challenge by the organisers of the biennial Critical Assessment of protein Structure Prediction (CASP) assessment. T.. 2020. 12. 31.