https://linen.dev logo
Join Discord
Powered by
# lime
  • t

    tall-teacher-57409

    05/04/2023, 6:14 PM
    which one?
  • h

    hallowed-ocean-84954

    05/04/2023, 6:19 PM
    Ok so in general I got didn't use either layout or version. Then I write the shaders compliant with the 'varying' syntaxand not in/ it variables. But I would suggest drop the layout and keepthe version so your shaders will still use in and out and thus be close to DeVries
  • t

    tall-teacher-57409

    05/04/2023, 6:21 PM
    alright got it
  • t

    tall-teacher-57409

    05/04/2023, 6:23 PM
    Copy code
    glsl
    #version 330 core 
    
                                void main()\n
                                {\n
                                    gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n
                                }\n
                    ";
    but aPos is not defined anymore now
  • h

    hallowed-ocean-84954

    05/04/2023, 6:23 PM
    Yeah you'll still need to define the attribute
  • t

    tall-teacher-57409

    05/04/2023, 6:24 PM
    oo I never touched attrs before, is that like
    #attribute aPos
    ?
  • h

    hallowed-ocean-84954

    05/04/2023, 6:24 PM
    Yep
  • h

    hallowed-ocean-84954

    05/04/2023, 6:25 PM
    I forget how the layout version looked. Part of the reason my code is like that is that I started with openfl and then moved to lime. Openfl uses an older syntax
  • t

    tall-teacher-57409

    05/04/2023, 6:26 PM
    ah I see
  • h

    hallowed-ocean-84954

    05/04/2023, 6:27 PM
    If I was writing something new I'd probably follow the layout approach but .... Haven't bothered with this yet
  • t

    tall-teacher-57409

    05/04/2023, 6:41 PM
    WebGL warning: linkProgram: Must have a compiled vertex shader attached: SHADER_INFO_LOG: ERROR: 0:2: ' ' : invalid version directive ERROR: 0:3: 'attribute' : invalid directive name ERROR: 0:9: 'aPos' : undeclared identifier ERROR: 0:9: 'x' : field selection requires structure or vector on left hand side ERROR: 0:9: 'aPos' : undeclared identifier ERROR: 0:9: 'y' : field selection requires structure or vector on left hand side ERROR: 0:9: 'aPos' : undeclared identifier ERROR: 0:9: 'z' : field selection requires structure or vector on left hand side
  • t

    tall-teacher-57409

    05/04/2023, 6:41 PM
    can't get rid of these annoying errors 😭
  • t

    tall-teacher-57409

    05/04/2023, 6:41 PM
    oh wait its attribute vec3 aPos
  • t

    tall-teacher-57409

    05/04/2023, 6:41 PM
    I think
  • h

    hallowed-ocean-84954

    05/04/2023, 6:46 PM
    Yep
  • t

    tall-teacher-57409

    05/04/2023, 6:53 PM
    WebGL warning: linkProgram: Must have a compiled vertex shader attached: SHADER_INFO_LOG: ERROR: 0:2: ' ' : invalid version directive now this
  • t

    tall-teacher-57409

    05/04/2023, 6:53 PM
    they all (shaders) got #version 330 core
  • h

    hallowed-ocean-84954

    05/04/2023, 7:06 PM
    Core won't work in webgl I think
  • h

    hallowed-ocean-84954

    05/04/2023, 7:08 PM
    It's gotta be es i think. Need to check the version directives. And 330 isn't valid for es.i cannot write remember but maybe '310 es'
  • t

    tall-teacher-57409

    05/04/2023, 7:09 PM
    oh ok lemme check rq
  • h

    hallowed-ocean-84954

    05/04/2023, 7:10 PM
    Maybe 300 es
  • h

    hallowed-ocean-84954

    05/04/2023, 7:11 PM
    Or drop the core bit
  • t

    tall-teacher-57409

    05/04/2023, 7:41 PM
    im getting this now

    https://cdn.discordapp.com/attachments/769686258049351722/1103768294508462201/image.pngâ–¾

  • t

    tall-teacher-57409

    05/04/2023, 7:42 PM
    idk what's wrong with my "program"
  • h

    hallowed-ocean-84954

    05/04/2023, 8:02 PM
    Do you have any errors from the shader comp ? I assume link failed because a shader didn't compile. I can't look right now but is the code anywhere I could look later ?
  • h

    hallowed-ocean-84954

    05/05/2023, 12:31 AM
    So on the VAO (createVertexArray) thing - I have code demoing instancing where it says works on the HTML5 target - I have notes that it doesn't work on HL, Windows - this uses VAO. Nothing else does so Zeta may well be right that this is not supported on Windows/HL.
  • h

    hallowed-ocean-84954

    05/05/2023, 2:37 AM
    Ok I tried a quick hack up to get the triangle going in the HelloWorld demo. It's totally doable as DeVries has it with layout and so on. It does need a few tweaks like for the
    #version
    , float precision specifier etc.. I threw up a Gist of the Main.hx in case it helps you. This runs on HTML5. Not tested anywhere else. .
  • t

    tall-teacher-57409

    05/05/2023, 7:19 AM
    Oh sorry for late reply, I slept and forgot about that. I tried the gist and it works! thanks!
  • t

    tall-teacher-57409

    05/05/2023, 7:38 AM
    im curious about something, why are there 3 calls for gl.bindBuffer btw? One at line 122, 124, and 147, and why does 124 bind
    null
    to
    gl.ARRAY_BUFFER
  • p

    powerful-morning-89

    05/05/2023, 7:48 AM
    In this very simple example having multiple bindBuffer calls is indeed redundant, but once you have multiple buffers you'll need multiple calls. Setting gl.ARRAY_BUFFER to null ensures that you don't accidentally do stuff to the wrong buffer if you forget a bindBuffer call somewhere.
1...104105106...138Latest