All Projects → ruofeidu → DuEngine

ruofeidu / DuEngine

Licence: other
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to DuEngine

Gpu Pro Books Source Code
💿 Source Code Collection of Book <GPU Pro> 1~ 7 | 《GPU Pro》1~ 7 书本源代码珍藏
Stars: ✭ 323 (+420.97%)
Mutual labels:  rendering, glsl, shader
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+3354.84%)
Mutual labels:  rendering, renderer, raytracing
Gpu Gems Book Source Code
💿 CD Content ( Source Code ) Collection of Book <GPU Gems > 1~ 3 | 《GPU精粹》 1~ 3 随书CD(源代码)珍藏
Stars: ✭ 567 (+814.52%)
Mutual labels:  rendering, glsl, shader
Shady
CLI tool to render GLSL shaders
Stars: ✭ 79 (+27.42%)
Mutual labels:  glsl, shadertoy, raytracing
Physics3d
A 3D physics engine
Stars: ✭ 101 (+62.9%)
Mutual labels:  engine, rendering, shader
Nabla
OpenGL/OpenGL ES/Vulkan/CUDA/OptiX Modular Rendering Framework for PC/Linux/Android
Stars: ✭ 235 (+279.03%)
Mutual labels:  rendering, glsl, raytracing
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (+25.81%)
Mutual labels:  rendering, renderer, raytracing
card-game-GLSL
card game in the single GLSL shader
Stars: ✭ 20 (-67.74%)
Mutual labels:  glsl, shader, shadertoy
ShaderBoy
Simple text editor that lets you write Shadertoy shaders more comfortably, anytime, anywhere.
Stars: ✭ 133 (+114.52%)
Mutual labels:  glsl, shader, shadertoy
Gears Vk
Powerful low-level C++20 rendering framework for Vulkan 1.2, including Real-Time Ray Tracing (RTX) support, built atop Auto-Vk.
Stars: ✭ 71 (+14.52%)
Mutual labels:  engine, rendering, raytracing
Bonzomatic
Live shader coding tool and Shader Showdown workhorse
Stars: ✭ 829 (+1237.1%)
Mutual labels:  glsl, shader, shadertoy
osgw
Real-Time Ocean Animation with Gerstner Waves
Stars: ✭ 51 (-17.74%)
Mutual labels:  rendering, glsl, shader
BBearEditor-2.0
My own 3D engine & editor in order to learn graphics algorithms and game engine architecture.
Stars: ✭ 32 (-48.39%)
Mutual labels:  glsl, shader, renderer
makma
Makma is a deferred Vulkan renderer written in C++.
Stars: ✭ 77 (+24.19%)
Mutual labels:  rendering, glsl, renderer
GLSLShaderShrinker
Optimizes the size of GLSL shader code.
Stars: ✭ 39 (-37.1%)
Mutual labels:  glsl, shader, shadertoy
Pixi.js
The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
Stars: ✭ 34,982 (+56322.58%)
Mutual labels:  rendering, glsl, renderer
Voxel Cone Tracing
A real-time global illumination implementation using voxel cone tracing. Implemented in C++ and GLSL.
Stars: ✭ 555 (+795.16%)
Mutual labels:  shader, renderer, raytracing
CLUSEK-RT
Vulkan based C++ ray-tracing game engine.
Stars: ✭ 24 (-61.29%)
Mutual labels:  engine, rendering, raytracing
Photon-v2
A program that takes photographs of a virtual world.
Stars: ✭ 75 (+20.97%)
Mutual labels:  rendering, renderer, raytracing
Messier87
A realtime raytracing blackhole renderer
Stars: ✭ 53 (-14.52%)
Mutual labels:  rendering, glsl, raytracing

DuEngine

DuEngine is an efficient and interactive C++ graphics engine for rendering, managing, recording image and video screenshots of ShaderToy-like demos with a variety of textures in real time. It contains algorithms on the GPU such as Poisson Editing, Antialiasing, Bilateral Filtering, Diffusion, Distrotion, Kernel Foveated Rendering, and rich ray marching / tracing demos. It's mostly used for personal references and most source files are located under DuEngine while the my shaders locates under DuShaders; algorithms are categorized under different subfolders. Currently, DuEngine supports 2D (jpg, png), 3D (binary file or grid image), video (mp4 or image sequences), lightfields (grid layout) textures. However, it only supports Windows and requires a graphics card with OpenGL 4.5+. One may mitagate the C++ code to Unix by replacing the OpenCV and Freeglut libraries.

LightFieldSingle

Compilation

Currently only Windows is supported. Please feel free to PR a Linux version. The original code is written in Visual Studio 2017 while I will use VS Code and clang-format with Google style for future commits.

Dependencies: OpenGL 4.5+, Glew, OpenCV 3.0+, GLM, Freeglut, and Visual Studio 2015+.

  1. To compile the project, simply run OpenSolution.cmd, or locate the solution file at DuEngine/DuEngine.sln
  2. To test the project, run RunTest.cmd, or UnitTests/debug.cmd, then you will see the renderer with all sorts of input channels.

If the compilation fails, please fix the following five environment variables:

  • OPENCV_INC: Directory to OpenCV include folder.
  • GLEW_INC: Directory to Glew, Freeglut, and GLM headers.
  • OPENCV_LIB: Directory to OpenCV libraries.
  • GLEW_LIB: Directory to Glew and Freeglut libraries.
  • PATH: Add the executable DLLs of OpenCV and GLUT into the PATH variable.

Create New Demos

Dependency: Python

To create a new ShaderToy demo, just click _create.cmd in any category folder like "Ray Tracing". In the console, please input your desired shader name, like "Test". The Python script will automatically generate Test.glsl, Test.ini, and Test.cmd files. Note that the GLSL file is the main Shadertoy alike GLSL code, the INI file is the config file which defines the input channels, and the CMD file is a shortcut for you to run the demo.

The detailed input format for _create.cmd is:

_create [FILE_NAME] [NUM_CHANNELS, 1 by default] [NUM_BUFFERS, 0 by default] [LINK_TO_SHADERTOY_FOR_REFERENCE]

Features

Config file

This renderer provides an easy-to-use interface to link any GLSL demos with built-in, and custom 2D, video, 3D, and cubemap textures. It supports most of the preset textures from the ShaderToy, which are located in DuEngine/presets.

To run the engine with a config file, simply run

DuEngine config.ini

The config file reads like as follows:

# This is a comment, $Name corresponds to the file name of the INI file.
shader_frag         =   $Name.glsl

# Specify the number of channels for the main framebuffer.
channels_count      =   5

# Specify the number of framebuffers for multi-pass rendering
buffers_count       =   4

# Here are some examples of the channel type.
# We pre-define most of the ShaderToy presets. Visit *DuEngine/Texture.cpp* for a glance:
iChannel0_type      =   noise
# iChannel0_type    =   key, font, stpeter, sjtu...

# For a custom texture file, you need to tell the type and filename with extension.
iChannel1_type      =   rgb
iChannel1_tex       =   whatever.png

# The filters and wraps are loaded by default, but you can also change them.
iChannel1_filter        =  mipmap
iChannel1_wrap          =   repeat

# For videos, you can add fps, startFrame, and endFrame.
iChannel2_type          =   video
iChannel2_tex           =   whatever.mp4
iChannel2_fps           =   25
iChannel2_startFrame    =   1
iChannel2_endFrame      =   100

# To read from a frame buffer, use A-Z.
iChannel3_type      =   A

# To read from a video sequence, use %d as the wildcard
iChannel4_type      =   videoseq
iChannel4_tex       =   myfolder/file%d.png

# Each frame buffer can have an arbitrary number of channels.
A_channels_count    =   1
A_iChannel0_type    =   london
B_channels_count    =   1
B_iChannel0_type    =   A
C_channels_count    =   1
C_iChannel0_type    =   B
D_channels_count    =   1
D_iChannel0_type    =   C

# You can ignore the following default parameters starting from this line:
window_width        =   1920
window_height       =   1080

# If your textures are located outside the presets folder, type something like
resources_path      =   ../resources/

Multipass

Full-featured multipass rendering, e.g., see ShaderOfWeek/Goo.cmd for an example.

Screenshots and Recording

Press F2 to take a screen shot. In the configuration file, please add the following lines to record a video / sequences of images:

recording       =   true
record_start    =   1
record_end      =   500
# Use true for generating a single video file; false for generating sequences of images
record_video    =   true

The video will be stored in record by default.

Functional Keys

F1      =   Reset the time and textures;
F2      =   Take screenshot;
F5      =   Recompile the shader;
F6      =   Pause / Play all videos;
F9      =   (Debug) Print iFrame;
F10     =   (Debug) Print iMouse;
F11     =   Toggle the fullscreen mode;

In the end, here stores some of my GLSL code written in Shadertoy.com My ShaderToy Public Profile

Demos and Blog Posts

Interactive Poisson Blending

Unified Gnomonic and Stereographic Projections

Dotted Drawing Sketch

Instgram Brannan Filter

BirthdayCakeNoOcclude

Code Golf: Halftone Image

Artisitc404

LightFieldSingle

  • Light Field Rendering VolumeRendering
  • Volume Rendering

Masterpieces from ShaderToy

  • Please refer to the GLSL code for author names.
  • Most of the shaders is under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
  • A few of the shaders are under MIT License. Alps LadyBug Venice WindWakerOcean RayTracing Bridge Bidirectional Path Tracing GameOfLife CrossPenguin

Author

Ruofei Du

License

DuEngine, DuShaders Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License with 996 ICU clause: 996.ICU

The above license is only granted to entities that act in concordance with local labor laws. In addition, the following requirements must be observed:

  • The licensee must not, explicitly or implicitly, request or schedule their employees to work more than 45 hours in any single week.
  • The licensee must not, explicitly or implicitly, request or schedule their employees to be at work consecutively for 10 hours.

Please refer to individual GLSL files (.glsl) for License of Third-Party Shaders.

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].