1 / 11

02 |Introduction to OpenGL

02 |Introduction to OpenGL. Eriq Muhammad Adams J | eriq.adams@ub.ac.id. What is OpenGL ?. Low-level Graphics API (Application Programming Interface) / antarmuka perangkat lunak ke kartu grafis.

sadah
Download Presentation

02 |Introduction to OpenGL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 02 |Introduction to OpenGL Eriq Muhammad Adams J | eriq.adams@ub.ac.id

  2. What is OpenGL ? • Low-level Graphics API (Application Programming Interface) / antarmuka perangkat lunak ke kartu grafis. • Independen terhadap platform (hanya menyediakan fungsi grafis, tidak menyediakan fungsi yang dependen terhadap platform : input handling, windowing, dsb). • Banyak digunakan di aplikasi grafis : CAD programs, games, data visualization, dsb.

  3. OpenGL History • Dikembangkan pertama kali oleh SGI (Silicon Graphics, Inc). • 1992 diambil alih oleh OpenGL ARB (Architecture Review Board) : 3DLabs, ATI, Dell, Evans & Sutherland, Hewlett-Packard, IBM, Intel, Matrox, NVIDIA, SGI, Sun Microsystems sebagai pembuat dan pengelola spesifikasi OpenGL. • 2006 dikontrol oleh The Khronos group.

  4. OpenGL Architecture • Sebuah state machine, contoh untuk menggambar objek dengan warna merah programmer harus merubah color state ke merah lalu menggambar objek tersebut. • Tetapi sejak OpenGL 3.0 (programmable pipeline/shader based) menjadi less state- oriented API : state functions untuk color, normals, lighting deprecated (kadaluarsa).

  5. Fixed-Function vs Programmability • Fixed-function pipeline dirancang utk berjalan di CPU (single-path rendering). • Programmable pipeline (shader based) dirancang utk berjalan di GPU sehingga lebih flexible dan mudah dikontrol oleh programmer. • Ada 3 jenis shaders : Vertex shaders (memodifikasi vertex), Fragment shaders (memodifikasi pixel), Geometry shaders (menggenerate vertices, dan bukan fitur inti).

  6. OpenGL Rendering Pipeline

  7. Related Libraries • GLUT (OpenGL Utility Toolkit) menyediakan fungsi untuk windowing, menus, input-handling. • SDL (Simple Direct Media Layer) : librari multimedia cross-platform . • GLFW : windowing, creating an OpenGL context and managing input .

  8. OpenGL Syntax • Diawali dengan awalan gl : glVertex3f() • Nomor menunjukkan jumlah parameter : glVertex3f(1.0f, 1.0f, 1.0f) punya 3 parameter • Huruf setelah nomor menunjukkan tipe data parameter : glVertex3f() bertipe data float.

  9. Simple CG Program Architecture Inisialisasi • Berisi kode inisialisasi : penciptaan window, loading resource, dsb . • berisi finite loop untuk update logika, dan rendering. Update logika Rendering Keluar ? De-Inisialisasi

  10. Setup OpenGL (using GLFW) • Silakan lihat petunjuk dan unduh contoh demo program di https://github.com/e4dams/grafika-komputer

  11. Hello OpenGL ! https://github.com/e4dams/grafika-komputer/tree/master/your_projects/Pertemuan_02

More Related