NOTE: This program utilizes Roblox’s EditableImage
feature, which requires developer age and ID verification.
The shader engine can run virtually any shader program that operates on a per-pixel basis, just like those on Shadertoy. Porting these programs are relatively easy due to their code structuring being similar. If you wish to test the abilities of this engine or understand how to write shader programs with this engine, you can use any of the give example shader programs provided, which are also ports of pre-existing shader programs in Shadertoy .
If you have an eye for possible optimizations, or how the shader could be better in any way, please feel free to contribute as this project is open-source and is open for contribution.
Features
-
Multithreading - shader program rendering is divided among an amount of worker threads, which is specified by the user. For practicality, this amount can only be a multiple of four.
-
Interlacing - this is a rendering technique that intentionally skips over the rendering of some amount of rows & columns per frame. It is employed to double the percieved frame rate but also boost performance as skipping reduces the amount of computations done per frame, increasing the likelyhood of the frame budget being satisfied, therefore reducing FPS decrease.
-
Partial re-implementation of common GLSL functions - a library containing some of the common graphics-related math operations is provided along the engine. Swizzling is not planned to be a feature of this library that is widely supported anytime in the future. As while it improves readability, the overhead from the additional function frame hurts overall performance.
-
Multiple shader buffer support (multipass) - a multipass system is provided by the engine; where the shader can go through function
bufferA
,bufferB
, etc. before finally going throughmainImage
. -
User input handling (mouse movement) - the mouses position within the shader’s viewport is tracked every left-click on the viewport, and stops tracking when the button is let go or the mouse goes outside the viewport.
Features that are planned to be implemented:
-
Texture channel sampling
-
Frame interpolation (possible performance gains are yet to be evauated)
Showcase
All video footage are from a laptop with an 11th Gen Intel i3 Core, and 8 GB of RAM
*The footage is actually a bit more smoother an less grainier live than in video
Voxel Shader
ported from @Xor on Shadertoy
180 by 120 pixels, with dual interlacing by the factor of 2
avg. 40-45 FPS
Voxel Tunnel
ported from @Elsio on Shadertoy
180 by 120 pixels, with dual interlacing by the factor of 2
avg. 24-27 FPS (Not so bad!? )
Shader Art
ported from @kishimisu on Shadertoy
180 by 120 pixels, with dual interlacing by the factor of 2
avg. 40-45 FPS
Gravity Sucks
ported from @mrange on Shadertoy
180 by 120 pixels, with dual interlacing by the factor of 2
avg. 25-30 FPS (ohh?! )
Resources
Learn about the latest release: v1.8.5
Learn how to use the module here: RbxShader Tutorial
You can download the shader by going to the GitHub repository and downloading the latest release. I do not expect this resource to be of use to a lot of people as of now. But at most I hope I can attract some shader nerds like me or really clever individuals (possibly you?) in making this project grow and mature. Thanks for reading, lovelots!