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

    bulky-insurance-39338

    05/04/2023, 4:19 PM
    *seeYou
  • t

    tall-teacher-57409

    05/04/2023, 4:20 PM
    👋
  • t

    tall-teacher-57409

    05/04/2023, 4:23 PM
    okay im happy with that

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

  • h

    hallowed-ocean-84954

    05/04/2023, 4:25 PM
    I don't see a drawelements or draw arrays call
  • h

    hallowed-ocean-84954

    05/04/2023, 4:25 PM
    You don't seem to be using an ibo, so probably drawarrays
  • t

    tall-teacher-57409

    05/04/2023, 4:26 PM
    wait you're right
  • t

    tall-teacher-57409

    05/04/2023, 4:26 PM
    I removed them when I tried to remove the vao
  • t

    tall-teacher-57409

    05/04/2023, 4:26 PM
    lemme ad dthem rq
  • t

    tall-teacher-57409

    05/04/2023, 4:31 PM
    Copy code
    hx
    var vertices:Array<Float> = [-0.5, -0.5, 0.0, 0.5, -0.5, 0.0, 0.0, 0.5, 0.0];
    
                    var gl = context.gles2;
                    var vbo = gl.createBuffer();
                    gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
                    gl.bufferData(gl.ARRAY_BUFFER, vertices.length, new Float32Array(vertices), gl.STATIC_DRAW);
    
                    var shader_src = "
                                layout (location = 0) in vec3 aPos;\n
    
                                void main()\n
                                {\n
                                    gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n
                                }\n
                    ";
    
                    var shader = gl.createShader(gl.VERTEX_SHADER);
                    gl.shaderSource(shader, shader_src);
                    gl.compileShader(shader);
    
                    var frag_shader_src = "
    
                                void main()\n
                                {\n
                                    FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n
                                }\n
                    ";
    
                    var frag_shader = gl.createShader(gl.FRAGMENT_SHADER);
                    gl.shaderSource(frag_shader, frag_shader_src);
                    gl.compileShader(frag_shader);
    
                    var program = gl.createProgram();
                    gl.attachShader(program, shader);
                    gl.attachShader(program, frag_shader);
    
                    gl.linkProgram(program);
    
                    gl.useProgram(program);
    
                    gl.deleteShader(shader);
                    gl.deleteShader(frag_shader);
    
                    gl.drawArrays(gl.TRIANGLES, 0, 3);
    is this okay now 😰 ?
  • h

    hallowed-ocean-84954

    05/04/2023, 4:33 PM
    If that's your render loop it looks ok though some of the stuff doesn't need to be on every loop. Question is does it work ?
  • t

    tall-teacher-57409

    05/04/2023, 4:33 PM
    unfortunately nope 😭

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

  • h

    hallowed-ocean-84954

    05/04/2023, 4:37 PM
    Ok. There is a triangle demo in the lime samples that might help you see what's missing. I'm on my phone so it's hard to see everything clearly. But just quickly I don't see where fragcolor is defined as an out var.i cannot remember how he does that normally.
  • t

    tall-teacher-57409

    05/04/2023, 4:38 PM
    oh ok will check it now, I removed the out because semmi told me that when I used gles2 instead of gles3
  • h

    hallowed-ocean-84954

    05/04/2023, 4:39 PM
    Ok but then you would use gl_FragColor
  • t

    tall-teacher-57409

    05/04/2023, 4:39 PM
    oh I thought you could name those anything
  • h

    hallowed-ocean-84954

    05/04/2023, 4:39 PM
    I think anyway
  • t

    tall-teacher-57409

    05/04/2023, 4:40 PM
    but still same result :/
  • t

    tall-teacher-57409

    05/04/2023, 4:40 PM
    btw where's that triangle demo can't find it in lime samples
  • h

    hallowed-ocean-84954

    05/04/2023, 4:41 PM
    Try here
  • t

    tall-teacher-57409

    05/04/2023, 4:41 PM
    that's everything

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

  • h

    hallowed-ocean-84954

    05/04/2023, 4:43 PM
    Hmmm....
  • t

    tall-teacher-57409

    05/04/2023, 4:56 PM
    come on, not now

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

  • t

    tall-teacher-57409

    05/04/2023, 5:30 PM
    ok im back to using webgl again, so its complaining about the layout keyword in the vertex shader, "syntax error"
  • t

    tall-teacher-57409

    05/04/2023, 5:34 PM
    WebGL warning: linkProgram: Must have a compiled vertex shader attached: SHADER_INFO_LOG: ERROR: 0:2: 'layout' : syntax error
  • h

    hallowed-ocean-84954

    05/04/2023, 6:04 PM
    I would guess that that is related to the shader version. I mostly didn't use layouts
  • t

    tall-teacher-57409

    05/04/2023, 6:07 PM
    sooo I just remove that layout line?
  • t

    tall-teacher-57409

    05/04/2023, 6:08 PM
    or change the version?
  • h

    hallowed-ocean-84954

    05/04/2023, 6:10 PM
    Right.
  • h

    hallowed-ocean-84954

    05/04/2023, 6:12 PM
    I don't think I have the triangle code anywhere. I think I went on to a cube pretty quickly and didn't keep that code
  • t

    tall-teacher-57409

    05/04/2023, 6:14 PM
    oh its ok :P
1...103104105...138Latest