OpenGL playground
JavaScript GLSL C++ Matlab HTML Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_old
docs
fragment_shader
screenshots
.gitignore
Makefile
README.md
bubbles.html
bubbles.js
glint.h
glmatrix-min.js
helloGL.cpp
phong-shading-sphere.cpp
phong-shading.cpp
phong-shading.html
phong-shading.js
sphere-animate.html
sphere-animate.js
sphere-deform.html
sphere-deform.js
sphereTest.m
vertexShader_v00.js
webgl-utils.js

README.md

opengLOL

Requirements

glew and glfw3, both availabe via homebrew:

$ brew install glew && brew install glfw3

Phong Shader

compile:

$ make phong

run:

$ ./phong.exe

new alt

Effervescent bubbles were built up in steps

Drawing

Shader #0 In which, we create a baby shader to test our development setup

Drawing Shader #1 In which, we test out gl_FragCoord

Drawing Shader #2 In which, we remember that we don't need gl_FragCoord and can just use the interpolated values from a drawn square.

Drawing Shader #3 In which, we expand our fictional world to include a sphere and a camera. If a ray emanating from the cemera through a pixel intersects the sphere, we draw that pixel in white.

Drawing Shader #4 In which, we compute the points at which a ray intersects the sphere, and then use that point to compute diffuse shading.