Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

GLSL shader emulation in software with C++ built for a ray tracer using the secant method but more general later

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 glsl
Octocat-spinner-32 sim
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.txt
Octocat-spinner-32 frag.c
Octocat-spinner-32 geom.h
Octocat-spinner-32 glsl.h
Octocat-spinner-32 vert.c
README.txt
Implicit Surface Shader Emulation
---------------------------------
James Halliday

Render implicit solids without having to do any more maths beyond pasting the
formula from wikipedia and tweaking the root intervals. Also emulate GLSL on the
CPU since programming on the GPU directly is painful. The GPU coordinates seem
to be a bit off still since most development has gone into the CPU-emulated
version.

Those issues aside, here's some stuff to try:
    make ppm
        Generate a ppm file with ./frag and display it with eog.
    
    ./Main cpu
        Launch the shader in cpu emulation mode.
        * Standard wasd navigation with hjkl rotation that mostly works.
        * Toggle cpu/gpu with 'c'
        * Recompile frag.c on both the cpu and gpu with 'r'
        * Space bar prints the state
        * Escape exits the app

More features:
    * GPU code with real #directives, thanks to cpphs preprocessing

Some useful incidental features:
    * In cpu mode, you can use std::cerr for debugging
    * Real gcc error messages when compiling in cpu mode
Something went wrong with that request. Please try again.