Giter Club home page Giter Club logo

playing-with-shaders's Introduction

My GLSL shaders playground

Mandelbrot set

Mandelbrot set movement controls

Keyboard

  1. Arrow keys (, , , and ) for moving around
  2. Z and X for zooming in and zooming out
  3. R to reset everything to the starting point
  4. Hold Alt to slow down movement and zooming and hold Shift to speed it up

Mouse

  1. Drag and Drop (click left mouse button and hold while moving the cursor)
  2. Zoom by scrolling the mouse wheel

How to run

I didn’t try and/or test it outside NixOS but technically if you install following dependencies you can just run make run and it should work for you:

  1. GCC
  2. GNU Make
  3. pkg-config
  4. xxd executable
  5. GLFW3
  6. GLEW
  7. General OpenGL C header files

With Nix

Either you enter a Nix Shell and run make commands:

nix-shell --run 'make run'

Or you can build the derivation and run it:

nix-build
result/bin/app

You can pre-build Nix development environment (to add a GC root and prevent it from being garbage collected unless you remove the result* symlink):

nix-build -A env -o result-env

Known issues

GNU/Make doesn’t recognize changes in *.glsl source files for some reason. So if you just change a shader without cleaning the cache you actually get previous result. I usually use touch src/main.cpp && make run as a hack to not clean the whole cache. Or you can use this hack for automatically recompile and run when you save any change in a shader file:

while true; do inotifywait -e create src/shaders/** ; touch src/main.cpp && make run; done

Author

Viacheslav Lotsmanov

playing-with-shaders's People

Contributors

unclechu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.