Shaders in Roblox?

So I’ve been playing with shaders on shader toy and I was wondering is there a way I can like import the shader code to roblox? I see references within the shader code to webgl. Then again this may just be cause im compiling it to a web gl context, that being shader toy. So say I had this shader. I am pretty sure I cant run it on roblox from the shader code it provides me cause it seems to be dependent on a web gl context, however what if in the IDE you see within the shader toy link, GLSL; could you make that into a shader?

#version 410
uniform vec3 webgl_f85dedfba4fa48e5;
uniform float webgl_fd9d67bbd573a839;
uniform float webgl_7dbd01b87f2020f8[4];
uniform vec4 webgl_355a9df205e90a96;
uniform vec4 webgl_c250bfc43e6a9ee8;
uniform float webgl_62c85afcea933559;
uniform vec3 webgl_6aad76855a00e94e[4];
uniform int webgl_5d5e8fd0f4b457f6;
uniform float webgl_c236a851d4ce443c;
uniform float webgl_975fae42b82676c5;
uniform sampler2D webgl_36c9542035e21584;
uniform struct {
sampler2D webgl_9c621a5ea6c77f32;
vec3 webgl_4f4a8b74675018f8;
float webgl_91242d0d295e4a40;
int webgl_bd310878ac11213a;
} webgl_ba045a519b8487b2;
uniform sampler2D webgl_dac488f6f9680335;
uniform struct {
sampler2D webgl_9c621a5ea6c77f32;
vec3 webgl_4f4a8b74675018f8;
float webgl_91242d0d295e4a40;
int webgl_bd310878ac11213a;
} webgl_a7c51171eecdf9ad;
uniform sampler2D webgl_66bce60acd6d22ca;
uniform struct {
sampler2D webgl_9c621a5ea6c77f32;
vec3 webgl_4f4a8b74675018f8;
float webgl_91242d0d295e4a40;
int webgl_bd310878ac11213a;
} webgl_e4b4dfb5af1400ca;
uniform sampler2D webgl_f802d1c1652ed49d;
uniform struct {
sampler2D webgl_9c621a5ea6c77f32;
vec3 webgl_4f4a8b74675018f8;
float webgl_91242d0d295e4a40;
int webgl_bd310878ac11213a;
} webgl_869cea4febc20a81;
void webgl_c4e1744a42e621c2(out vec4 webgl_b79fa51523a10f88, in vec2 webgl_b259a649ace71a43);
out vec4 webgl_503009f37d5f1cc;
void main(){
(webgl_503009f37d5f1cc = vec4(0.0, 0.0, 0.0, 0.0));
(webgl_503009f37d5f1cc = vec4(1.0, 1.0, 1.0, 1.0));
vec4 webgl_19dff938713edbff = vec4(0.0, 0.0, 0.0, 1.0);
webgl_c4e1744a42e621c2(webgl_19dff938713edbff, gl_FragCoord.xy);
if ((webgl_503009f37d5f1cc.x < 0.0))
{
(webgl_19dff938713edbff = vec4(1.0, 0.0, 0.0, 1.0));
}
if ((webgl_503009f37d5f1cc.y < 0.0))
{
(webgl_19dff938713edbff = vec4(0.0, 1.0, 0.0, 1.0));
}
if ((webgl_503009f37d5f1cc.z < 0.0))
{
(webgl_19dff938713edbff = vec4(0.0, 0.0, 1.0, 1.0));
}
if ((webgl_503009f37d5f1cc.w < 0.0))
{
(webgl_19dff938713edbff = vec4(1.0, 1.0, 0.0, 1.0));
}
(webgl_503009f37d5f1cc = vec4(webgl_19dff938713edbff.xyz, 1.0));
}
float webgl_23f75988f30f11ce(in float webgl_4fc82888d13de398){
return (1.0 / (1.0 + pow(2.7179999, webgl_4fc82888d13de398)));
}
void webgl_c4e1744a42e621c2(out vec4 webgl_b79fa51523a10f88, in vec2 webgl_b259a649ace71a43){
vec2 webgl_61877257468f108d = (webgl_b259a649ace71a43 / webgl_f85dedfba4fa48e5.x);
(webgl_61877257468f108d.x -= 0.5);
(webgl_61877257468f108d.x *= 10.0);
vec2 webgl_a26058f549cd8dbf = (webgl_b259a649ace71a43 / webgl_f85dedfba4fa48e5.y);
(webgl_a26058f549cd8dbf.y -= 0.25);
(webgl_a26058f549cd8dbf.y *= 2.0);
float webgl_75c422100f18a043 = webgl_23f75988f30f11ce(webgl_61877257468f108d.x);
if ((((webgl_a26058f549cd8dbf.y <= webgl_75c422100f18a043)) ? ((webgl_a26058f549cd8dbf.y >= (webgl_75c422100f18a043 - 0.0099999998))) : (false)))
{
(webgl_b79fa51523a10f88 = vec4(1.0, 1.0, 1.0, 1.0));
}
else
{
(webgl_b79fa51523a10f88 = vec4(0.0, 0.0, 0.0, 1.0));
}
}
float graphFunction(float x) {
  return 1.0/(1.0+pow(2.718, x));
}
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uvx = fragCoord/iResolution.x;
    uvx.x -= 0.5;
    uvx.x *= 10.0;
    vec2 uvy = fragCoord/iResolution.y;
    uvy.y -= 0.25;
    uvy.y *= 2.0;
    float y = graphFunction(uvx.x);
    if (uvy.y <= y && uvy.y >= y-0.01) {
      fragColor = vec4(1,1,1,1);
      }
    else {
      fragColor = vec4(0, 0,0,1);
    }
}
2 Likes

I believe this is not possible at the moment since creating GLSL Shaders is considered as a security hazard since you are modifying Roblox files. However, Roblox possibly uses GLSL 3 ES shaders (I could be wrong). You could try tinkering with the shaders by going to the Roblox directory → shaders → shaders_glsl3.pack. The top of the file is a bunch of encrypted “mumbo jumbo”, but below that mumbo jumbo, there is shader code (I used Notepad++ since I’m not sure what application can open a .pack file). However, there are checks ran by Roblox to make sure that nothing is modified or missing. You could try tinkering with this file, however you are likely to corrupt the entire shader, therefore corrupting the entire application.

An alternative way of getting shaders into Roblox, specifically post processing shaders, is ReShade. ReShade is a post-processing injector that works with Roblox. It uses a coding language called HLSL, which is very similar to GLSL. If you are proficient with GLSL, I believe that HLSL would be easy to work with.

Hope this helps :slight_smile:

6 Likes