All Projects → raedatoui → Learn Opengl Golang

raedatoui / Learn Opengl Golang

Learn OpenGL Tutorials in Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Learn Opengl Golang

Renderpipeline
Physically Based Shading and Deferred Rendering for the Panda3D game engine
Stars: ✭ 814 (+1079.71%)
Mutual labels:  opengl, glsl
Tess Opt
Demonstration of how we can use tessellation shaders to make faster fragment shaders.
Stars: ✭ 13 (-81.16%)
Mutual labels:  opengl, glsl
Bonzomatic
Live shader coding tool and Shader Showdown workhorse
Stars: ✭ 829 (+1101.45%)
Mutual labels:  opengl, glsl
Ouzel
C++ game engine for Windows, macOS, Linux, iOS, tvOS, Android, and web browsers
Stars: ✭ 607 (+779.71%)
Mutual labels:  opengl, glsl
Shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Stars: ✭ 1,146 (+1560.87%)
Mutual labels:  opengl, glsl
Glsl Pathtracer
A GLSL Path Tracer
Stars: ✭ 634 (+818.84%)
Mutual labels:  opengl, glsl
Nau
Nau - OpenGL + Optix 3D Engine
Stars: ✭ 18 (-73.91%)
Mutual labels:  opengl, glsl
Pmtech
Lightweight, multi-platform, data-oriented game engine.
Stars: ✭ 478 (+592.75%)
Mutual labels:  opengl, glsl
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+16853.62%)
Mutual labels:  opengl, glsl
Melo
melo is mesh loader for OBJ, glTF2 and PLY
Stars: ✭ 41 (-40.58%)
Mutual labels:  opengl, glsl
Glchaos.p
3D GPUs Strange Attractors and Hypercomplex Fractals explorer - up to 256 Million particles in RealTime
Stars: ✭ 590 (+755.07%)
Mutual labels:  opengl, glsl
Graphics Snippets
Shading techniques and GLSL snippets
Stars: ✭ 53 (-23.19%)
Mutual labels:  opengl, glsl
Olive
Free open-source non-linear video editor
Stars: ✭ 5,682 (+8134.78%)
Mutual labels:  opengl, glsl
Imogen
GPU Texture Generator
Stars: ✭ 648 (+839.13%)
Mutual labels:  opengl, glsl
Awesome Glsl
🎇 Compilation of the best resources to learn programming OpenGL Shaders
Stars: ✭ 530 (+668.12%)
Mutual labels:  opengl, glsl
Leaf3d
A lightweight 3D rendering engine based on modern OpenGL
Stars: ✭ 16 (-76.81%)
Mutual labels:  opengl, glsl
Taisei
A free and open-source Touhou Project fangame
Stars: ✭ 428 (+520.29%)
Mutual labels:  opengl, glsl
Graphicsfuzz
A testing framework for automatically finding and simplifying bugs in graphics shader compilers.
Stars: ✭ 448 (+549.28%)
Mutual labels:  opengl, glsl
Pixelflow
A Processing/Java library for high performance GPU-Computing (GLSL). Fluid Simulation + SoftBody Dynamics + Optical Flow + Rendering + Image Processing + Particle Systems + Physics +...
Stars: ✭ 978 (+1317.39%)
Mutual labels:  opengl, glsl
Shaderworkshop
Interactive GLSL fragment shaders editor made with Qt
Stars: ✭ 43 (-37.68%)
Mutual labels:  opengl, glsl

OpenGL Tutorial in Go

  • Based on the excellent tutorial by Joey de Vries
  • uses go-gl for all OpenGL Go bindings

Installation

This is setup has only been tested on macOS. I am currently working with the 4.1 core profile on macOS, which is the latest version that ships with it. I didn't want to delve into upgrading that manually.

I figured I would get linux machine at a later time if I needed to use newer features in the API. The nice thing about go-gl is that you can install multiple profiles and write different programs targeting different version of OpenGL.

go-gl packages

1- gl - OpenGL core profile v4.1 go get -u github.com/go-gl/gl/v4.1-core/gl

2- Glow - Go binding generator for OpenGL

go get github.com/go-gl/glow
cd $GOPATH/src/github.com/go-gl/glow
go build
./glow download
./glow generate -api=gl -version=4.1 -profile=core -remext=GL_ARB_cl_event
# the profile is now installed in a gl directory
go install ./gl

3- GLFW 3.2 - Go bindings for GLFW 3 go get -u github.com/go-gl/glfw/v3.2/glfw

4- MathGL - A pure Go 3D math library go get github.com/go-gl/mathgl/...

This package is the equivalent of the GLM library and probably has all the functionality but after some differences. I didnt dive too deep into it, but I am getting different matrices when running the same sample in C++ with glm vs Go with mgl32.

To test that the installation is working, try the examples from go-gl.

go get github.com/go-gl/example
cd $GOPATH/src/github.com/go-gl/example
go run gl41core-cube/cube.go

learnopengl.com tutorial

1- assimp - Go wrapper of Assimp

First, install Assimp on macOS using homebrew brew install assimp

Then install wrapper, go get github.com/raedatoui/assimp

2- glutils

Some of the utllities developed throughout the tutorials like shader compilation and linking, camera, loading textures, loading models from assimp, other redundant GL commands,etc were packaged together. Initially, these lived within the tutorial repo as the utils package and we later moved to a dedicated repo in the hope of being useful for other projects.

go get github.com/raedatoui/glutils

3- glfont - A modern opengl text rendering library for golang

go get github.com/raedatoui/glfont

I made minor changes to this package where I use the shader functions from the glutils package and I explicitly set the profile version in the imports to 4.1 intead of all-core

Text rendering sucks and is not intended to look good, but good enough and easy to use for the sake of this tutorial.

Run

go get github.com/raedatoui/learn-opengl-golang
cd $GOPATH/src/github.com/raedatoui/learn-opengl-golang
go run tutorial.go

and you should see this screen

Use the right and left arrow keys to navigate through the tutorials.

Use the num keys to jump between sections.

Alt text

Notes

When configuring vertex attribute arrays, the stride is calculated using the size of a float32 type.

  • sizeof(GLfloat) is 4 , float32
  • size of uint32 - 4
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].