GlslViewer is a flexible console-base OpenGL Sandbox to display 2D/3D GLSL shaders without the need of an UI

Overview

glslViewer Build Status

Donate

GlslViewer is a flexible console-base OpenGL Sandbox to display 2D/3D GLSL shaders without the need of an UI. You can definitely make your own UI or wrapper using the Python Module (include) or any other tool that communicates back/forth with glslViewer thought the standard POSIX console In/Out or OSC.

Joing #GlslViewer channel on shader.zone discord to learn how to use it, share work and get help.

GlslViewer gives support to:

  • fragment and vertex shaders on GLSL
  • resolve #include dependencies
  • adding/deleting #define keys through console IN commands and OSC
  • automatically generated set of defines based on the platform, buffer, render pass, geometry attributes and materials properties.
  • passing custom uniforms (float, int, vec2, vec3 and vec4) through console IN or OSC
  • Different kinds of Textures (png, bmp, jpg, tga, hdr, gif, mp4, mov, rtc, rtsp, local camera devices and audio textures)
  • import of Cubemaps and spherical harmonics (png, jpg, tga, hdr)
  • import LST, PLY, OBJ or GLTF files (and their dependencies)
  • default vert/frag shaders for 2D shader and 3D material shaders with PBR lighting model
  • hot reload of files on changes
  • One default light and one default camera
  • Interactive commands thought POSIX console IN/OUT or OSC
  • different debug modes (histogram, textures, buffers, bounding box, etc)
  • shadow maps
  • headless rendering
  • fullscreen and screensaver mode
  • HoloPlay rendering on LookingGlass Display
  • image export
  • PNG sequence export
  • WASM crosscompiling

Wiki themes

Author

Patricio Gonzalez Vivo: github | twitter | instagram | website

Acknowledgements

Thanks to:

Comments
  • Support for GL (Full KMS) or GL (Fake KMS) on RaspberryPi

    Support for GL (Full KMS) or GL (Fake KMS) on RaspberryPi

    When attempting to run glslViewer on a Raspberry Pi 3 B+ running Raspbian 9 (stretch), it throws the following error:

    glslViewer: src/app.cpp:493: glm::ivec2 getScreenSize(): Assertion `success >= 0' failed.
    Aborted
    

    At least one other user experienced this issue back in 2017, as reported here: https://www.raspberrypi.org/forums/viewtopic.php?t=179373

    enhancement 
    opened by evanmtp 25
  • Failing to install glslViewer on Raspberry Pi OS Lite

    Failing to install glslViewer on Raspberry Pi OS Lite

    I'm have the "lite" version of Raspberry Pi OS installed in a Raspberry Pi 3.

    Am I trying something crazy? I'm finding the following problems:

    • glslViewer can't be found on apt
    • Can't add the ppa
    • Compiling from the source will fail like this:
    ...
    -- Check size of unsigned short
    -- Check size of unsigned short - done
    -- Searching 16 bit integer - Using unsigned short
    -- Check if the system is big endian - little endian
    -- package_details.cmake: your architecture is armhf
    -- Configuring incomplete, errors occurred!
    See also "/home/pi/glslViewer/build/CMakeFiles/CMakeOutput.log".
    See also "/home/pi/glslViewer/build/CMakeFiles/CMakeError.log".
    make: *** [Makefile:3: default] Error 1
    
    • Installing from the release files (without X) will fail like this:
    ./bin/glslViewer: error while loading shared libraries: libopenmaxil.so: cannot open shared object file: No such file or directory
    

    The weird thing is that I had this running on a Lite distro earlier this year... :scratching_head:

    bug 
    opened by murilopolese 24
  • Asynchronously write rendered frames to disk

    Asynchronously write rendered frames to disk

    The sequence command renders a sequence of frames and writes it to disk. I noticed, that rendering is normally faster than writing the images to disk. Therefore I used multiple threads to save the previously rendered frames.

    See https://github.com/patriciogonzalezvivo/glslViewer/issues/207#issue-831277825

    opened by ben-hansske 21
  • OSC Improvements

    OSC Improvements

    Hi, two quick notes (re. GlslViewer 1.7.0)

    1. Would be great if in OSC listening mode, you can disable verbose output

    2. Can precision be set? I only see 3 digits after the comma in the verbose output even though I am sending at 6 digits after the comma (see pic below - TX is what's being sent)

    CaptureOSC

    opened by ErikOostveen 16
  • Support higher versions of GLSL

    Support higher versions of GLSL

    Hi ! This tool is awesome, simple yet powerful, thanks for sharing and also for the rest of your work.

    I can achieve almost everything I fancy with glslViewer. The only limitation I have is that only glsl 120 is supported. Would it be complicated to enable use of newer versions ?

    For context : I'm trying to learn some particle systems stuff, mostly inspired by examples from shadertoy and they heavily use bitwise operations and textureSize or textureLod to process particle data stored in the buffer.

    opened by theottm 15
  • How to change the audio-input source to something that is not the mic?

    How to change the audio-input source to something that is not the mic?

    When I pipe in audio into my visuals I usually use some virtual audio interface (like Blackhole) to pipe the system audio into my visuals software which can this then use as an audio input.

    Is there a possibility to do something like this also with glslViewer or is the mic "hardcoded" into it?

    opened by TimPietrusky 14
  • Can't open shaders on Raspberry Pi 4

    Can't open shaders on Raspberry Pi 4

    glslViewer installs via apt-get without issue, but attempting to run a shader with glslViewer from the command line results in:

    * failed to add service - already in use?
    

    Any ideas?

    bug 
    opened by jmwohl 13
  • Cannot import from ShaderToy via loader

    Cannot import from ShaderToy via loader

    I wanted to read/understand the code of this ShaderToy shader (https://www.shadertoy.com/view/4s2SRt), suggested by the book, but I couldn't do it.

    1. Copy and pasting the code to editor, it gave an error:
    x'' : No precision specified for (float)
    
    1. I've inserted the medium precision snippet at the top, and now it tells me:
    'iTime' : undeclared identifier
    

    Isn't there some kind of automatic detection for ShaderToy's variables? Or it is only in glslViewer?

    1. I tried installing glslViewer and use the loader on OS X via brew. Installed fine, but needed requests. OK, I install requests into a virtualenv and launch from there.
    glslLoader 4s2SRt
    https://www.shadertoy.com/api/v1/shaders/4s2SRt?key=rt8tWH
    Traceback (most recent call last):
      File "/usr/local/bin/glslLoader", line 30, in <module>
        if len(data['Shader']['renderpass']) == 1:
    KeyError: 'Shader'
    

    Which might make sense, as the above link actually returns "Error": "Shader not found". Is it a bug in ShaderToy?

    1. Anyway, I finally save the shader's code into a .frag file and try to launch glslViewer test.frag, it I get the same error as on editor.
    ERROR: 0:132: Use of undeclared identifier 'iTime'
    ERROR: 0:133: Use of undeclared identifier 'p'
    

    Can you help me how to import ShaderToy shaders into glslViewer or editor? Should I manually search and replace variables, etc.? Any idea why is the API not working?

    opened by hyperknot 12
  • u_mouse values off by about half the normalized coordinate space

    u_mouse values off by about half the normalized coordinate space

    The following snippet works perfectly well in the online editor as well as shadertoy:

    #ifdef GL_ES
    precision mediump float;
    #endif
    
    uniform vec2 u_resolution;
    uniform vec2 u_mouse;
    uniform float u_time;
    
    void main() {
        
        vec2 st = gl_FragCoord.xy/u_resolution.xy;
        vec2 normouse = u_mouse.xy / u_resolution.xy;
        
        gl_FragColor = vec4(0.0,0.0,1.0,0.5);
        
        if (normouse.x < st.x) {
            gl_FragColor = vec4(1.0,0.0,0.0,0.5);
        }
        
        if (normouse.y < st.y) {
            gl_FragColor = vec4(0.0,1.0,0.0,0.5);
        }   
    }
    

    In glslViewer however, the x-coordinate only works for half the screen, and the y-coordinates seems to by off by about 0.5 (normalized), only filling half the screen when the mouse reaches the top of the window. I'm testing on a 2016 MacBook Pro, with the screen scaled down a bit.

    bug 
    opened by tambarskjelve 12
  • supply a download of the built glslViewer for macOS

    supply a download of the built glslViewer for macOS

    hello,

    i have tried building this a few times through brew, but it does error. i have resorted to uninstalling then installing but no dice.

    could you by chance suppyl a download of the built file? i know i place it in /usr/local/bin/ but would like to do it that way, rather than download loads of things again and again.

    thanks

    opened by lewislepton 12
  • glfw git clone is borked (Permission denied)

    glfw git clone is borked (Permission denied)

    [email protected]:~# git clone [email protected]:glfw/glfw.git
    Cloning into 'glfw'...
    Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
    Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    why not simply:

    sudo apt-get install glslViewer
    
    opened by Tcll 12
  • Fix: Promote project's standards to `C++17`

    Fix: Promote project's standards to `C++17`

    • As titled. :tada:
    • Many greater benefits compared to C++11, especially to do with constexpr, lambdas, and standard algorithms.
    • This gives developers tools to refactor the codebase and to express intent of code, in a much more simple way, (with a focus) to other developers reading the project's code.
    opened by tcoyvwac 0
  • Compile error in MacOS

    Compile error in MacOS

    env: MacOS 11.6

    Error info:

    ...
    glslViewer/src/tools/text.cpp:90:21: error: chosen constructor is explicit in copy-initialization
            std::smatch match = {};
    ...
    

    the compilation is successful after modified like this std::smatch match = {}; to
    std::smatch match = std::smatch();

    opened by zhengying 5
  • macOS issues with #version directive

    macOS issues with #version directive

    Currently trying to run glslViewer on macOS, but unfortunately, the #version directive seems to fail on all of the tests listed in examples/2D/00_tests/ that have a #version directive:

    $ glslViewer examples/2D/00_tests/test_330.frag
    
    Errors while compiling vertex shader:
    ERROR: 0:1: '' :  version '330' is not supported
    

    This message repeats quite a few times.

    This is on both main and 2.0.0, on macOS 12.0.1. I compiled and installed using the default make and make install commands.

    opened by StarWitch 6
  • add-apt-repository fails

    add-apt-repository fails

    Hello, I am trying to add the repository (sudo add-apt-repository ppa:patriciogv/glslviewer-ppa) on PopOS but I receive this error:

    E: The repository 'http://ppa.launchpad.net/patriciogv/glslviewer-ppa/ubuntu hirsute Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    
    
    opened by edap 4
  • Problems running on Windows using Powershell

    Problems running on Windows using Powershell

    I've followed the setup instructions for Windows but I'm running into some strange problems. Using powershell, I will run glslViewer on one shader and it will open up only to close immediately. In another directory, I will open a shader and it will remain open but it does not have the ability to reload the shader if it's updated.

    Using Git Bash, I do not bump into these problems and the app seems to work just fine.

    opened by LoganLang 3
Releases(2.1.2)
๐ŸŽฎ 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.

Lettier 13.7k Sep 22, 2022
The flexible game engine.

The flexible game engine. Crown is a general purpose and data-driven game engine, written in orthodox C++ with a minimalistic and data-oriented design

Daniele Bartolini 1.7k Sep 20, 2022
3D games console based on RP2040 and iCE40 UP5k

PicoStation 3D This is an unfinished, untested project to develop a 3D games console based on an RP2040 microcontroller and an iCE40 UP5k FPGA. Quick

Luke Wren 37 Sep 12, 2022
OGRE is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware.

OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos utilising 3D hardware. The class library abstracts all the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other intuitive classes.

null 3k Sep 24, 2022
A tetris game on windows console written in C++.

TetrisConsole A tetris game on windows console written in C++. For Course de Introduction to Data Structure and Algorithm Analysis, BUPT 2021. Notice

Ellias Kiri Stuart 6 Jun 12, 2021
A game console based upon custom hardware.

handheld-game-console A handheld game console that has custom games. The base of the console is an ESP-WROOM-32 DEVKITV1. The display used is an ili94

Builder212 1 Jul 30, 2022
Using Astar 2d simple console game

Journey-to-a-astar About this game Astar ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ๋ณ€ํ˜•ํ•˜์—ฌ ์ด์šฉํ•œ 2D๋งต ๊ฒŒ์ž„์ž…๋‹ˆ๋‹ค. ๊ฒŒ์ž„์˜ ๋ชฉํ‘œ๋Š” โ˜…(a star)์— ๋„๋‹ฌํ•˜๋Š” ๊ฒƒ ์ž…๋‹ˆ๋‹ค. ๋ณ„์„ ์ง€ํ‚ค๋Š” ์ ์ด ํ”Œ๋ ˆ์ด์–ด๋ฅผ ์ซ“์•„์˜ต๋‹ˆ๋‹ค. ์ ์—๊ฒŒ ์žกํžˆ์ง€ ์•Š๊ณ  ์ตœ๋Œ€ํ•œ ๋น ๋ฅธ์‹œ๊ฐ„์•ˆ์— ๋ณ„์— ๋„๋‹ฌํ•˜๋ฉด

Minseob Kim 1 Dec 10, 2021
A Game Boy game that rewards you for playing it on several console models!

GB Corp. A Game Boy game for the Game Boy Competition 2021 by Dr. Ludos (2021) This is the source code, you can get a precompiled rom from here: https

Dr. Ludos 9 Oct 21, 2021
noclip is a single-header backend for a developer console

noclip Many computer games have a developer console or in-game console which provide a command-line interface for executing commands, changing game va

Kevin Chin 8 Mar 20, 2022
A Console Based Arithmetic Program/Game

Welcome to Operator Fill This is a console based MATH program/game made in C++ which in current stage has 700+ lines of code.(I have plans to make it

Asutosh Mishra 2 Jan 12, 2022
Flexible, extensible, and scalable video game matchmaking.

Open Match is an open source game matchmaking framework that simplifies building a scalable and extensible Matchmaker. It is designed to give the game

GoogleForGames 2.6k Sep 23, 2022
This template provides a base structure to start developing a small raylib game in plain C

This template provides a base structure to start developing a small raylib game in plain C. The repo is also pre-configured with a default LICENSE (zlib/libpng) and a README.md (this one) to be properly filled by users.

Ray 107 Sep 21, 2022
crwusiz branch is comma.ai devel-staging base xx979xx HKG_community source add

crwusiz openpilot crwusiz branch is comma.ai devel-staging base xx979xx HKG_community source add v0.8.9 [ allow white panda and gray panda, OP3T suppo

Lee Jong Mun 30 Sep 18, 2022
A modification for Donkey Kong 64 that enables switching character at any time, without backtracking.

Donkey Kong 64 - Tag Anywhere V5 Made with โค๏ธ by Isotarge With help from: Tom Ballaam Murdyll 2dos Mittenz retroben Kaze Emanuar SubDrag runehero123 S

Isaac Miell 11 Jul 30, 2022
Epoxy is a library for handling OpenGL function pointer management for you

Epoxy is a library for handling OpenGL function pointer management for you. It hides the complexity of dlopen(), dlsym(), glXGetProcAddress(), eglGetP

Eric Anholt 565 Sep 22, 2022
An OpenGL Engine Written In C Using A Very OOP-Like Way Of Programming

A Simple Engine in its very first stages of becoming a, Game Engine or just a framework for making games using OpenGL. Here are the features of the Op

DevHedron 26 Jul 9, 2022
A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.

A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.

Samuel Rasquinha 52 Sep 20, 2022
A simple 2d snake game made using opengl in c++

opengl-snakegame A simple 2d snake game made using opengl in c++ Demo Keyboard Controls P - To resume/start or pause the game R - To restart the game

Dhruv Sawarkar 2 Dec 8, 2021
A minecraft clone built in c++ opengl for the purpose of prefecting graphics programming skills.

LearnOpenGL - CLion This is a project template for OpenGL development with JetBrains CLion IDE. It was created mainly for LearnOpenGL tutorials. Inclu

Jeremy Dellock 1 Dec 28, 2021