https://linen.dev logo
Join Discord
Powered by
# flixel
  • e

    enough-lawyer-1858

    02/20/2023, 2:00 PM
    (sorry for the ping)
  • w

    witty-island-52596

    02/20/2023, 3:33 PM
    can you post the glsl code in backticks like this \`\`\`glsl // code here \`\`\` making it
    Copy code
    glsl
    gl_fragColor = vec4(1.0, 1.0, 1.0, 0.0);
  • m

    mysterious-intern-42609

    02/20/2023, 4:33 PM
    Copy code
    glsl
        #pragma header
    
        uniform float iTime;
        uniform vec2 iResolution;
    
        void main()
        {
            // uv (0 to 1)
            vec2 uv = openfl_TextureCoordv;
            
            // uv (-1 to 1, 0 - center)
            uv.x = 2. * uv.x - 1.;
            uv.y = 2. * uv.y - 1.;
            
            float barrel_power = 0.80; // increase for BIGGER EYE!
            float theta = atan(uv.y, uv.x);
            float radius = length(uv);
            radius = pow(radius, barrel_power);
            uv.x = radius * cos(theta);
            uv.y = radius * sin(theta);
            
            // uv (0 to 1)
            uv.x = 0.5 * (uv.x + 1.);
            uv.y = 0.5 * (uv.y + 1.);
        
            float chromo_x = 0.2;
            float chromo_y = 0.2;
            
            // output
            gl_FragColor = vec4(flixel_texture2D(bitmap, vec2(uv.x - chromo_x*0.016, uv.y - chromo_y*0.009)).r, flixel_texture2D(bitmap, vec2(uv.x + chromo_x*0.0125, uv.y - chromo_y*0.004)).g, flixel_texture2D(bitmap, vec2(uv.x - chromo_x*0.0045, uv.y + chromo_y*0.0085)).b, 1.0);;
        }
  • m

    mysterious-intern-42609

    02/20/2023, 4:33 PM
    I don't think that is it
  • w

    witty-island-52596

    02/20/2023, 4:34 PM
    literally says 1.0
  • m

    mysterious-intern-42609

    02/20/2023, 4:35 PM
    I tried to change it to 0.0
  • m

    mysterious-intern-42609

    02/20/2023, 4:35 PM
    And it didn't work
  • m

    mysterious-intern-42609

    02/20/2023, 4:35 PM
    It just made everything black
  • m

    mysterious-intern-42609

    02/20/2023, 4:35 PM
    Including the hud
  • w

    witty-island-52596

    02/20/2023, 4:35 PM
    lets find out why
  • m

    mysterious-intern-42609

    02/20/2023, 4:36 PM
    The thing is, whenever I apply it to camGame it works normally
  • m

    mysterious-intern-42609

    02/20/2023, 4:36 PM
    But whenever I apply it to camHUD it makes everything under camHUD black
  • w

    witty-island-52596

    02/20/2023, 4:36 PM
    what is the bgcolor of camhud
  • m

    mysterious-intern-42609

    02/20/2023, 4:37 PM
  • w

    witty-island-52596

    02/20/2023, 4:37 PM
    so, the problem is that the entire shader is using the same alpha
  • e

    enough-lawyer-1858

    02/20/2023, 4:37 PM
    maybe you should get the alpha of the bitmap instead of making a solid 1.0 alpha?
  • w

    witty-island-52596

    02/20/2023, 4:38 PM
    ^
  • e

    enough-lawyer-1858

    02/20/2023, 4:38 PM
    i mean, the transparent color at the end of the day is just black with alpha set to 0
  • e

    enough-lawyer-1858

    02/20/2023, 4:38 PM
    so, when you set it to 1, it becomes black
  • w

    witty-island-52596

    02/20/2023, 4:39 PM
    although why would everything be black when alpha is set to 0
  • w

    witty-island-52596

    02/20/2023, 4:40 PM
    you think it would just show the game cam
  • e

    enough-lawyer-1858

    02/20/2023, 4:40 PM
    it should be
  • w

    witty-island-52596

    02/20/2023, 4:40 PM
    makes me think something else is the issue
  • w

    witty-island-52596

    02/20/2023, 4:41 PM
    if there's no shader on the hud cam does it looks normal?
  • m

    mysterious-intern-42609

    02/20/2023, 4:41 PM
    Yeah
  • w

    witty-island-52596

    02/20/2023, 4:41 PM
    the hud just shows over the game with no black covering
  • w

    witty-island-52596

    02/20/2023, 4:42 PM
    what happens if you do
    Copy code
    glsl
    gl_FragColor = flixel_texture2D(bitmap, uv);
  • m

    mysterious-intern-42609

    02/20/2023, 4:43 PM
    Gonna try it rq
  • w

    witty-island-52596

    02/20/2023, 4:43 PM
    or maybe
    Copy code
    glsl
    gl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv);
  • s

    swift-hospital-19424

    02/20/2023, 4:44 PM
    why did backdrop have to change
1...945894599460...9809Latest