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

    bulky-insurance-39338

    05/04/2023, 4:02 PM
    cos later you do not wanna only draw a single one .)
  • t

    tall-teacher-57409

    05/04/2023, 4:02 PM
    yep
  • t

    tall-teacher-57409

    05/04/2023, 4:02 PM
    bruh
  • t

    tall-teacher-57409

    05/04/2023, 4:02 PM
    still null access
  • t

    tall-teacher-57409

    05/04/2023, 4:02 PM
    i tried it again on hl with gles3
  • b

    bulky-insurance-39338

    05/04/2023, 4:04 PM
    mhm, if i am test here on linux for hl-target it only detects ES2
  • t

    tall-teacher-57409

    05/04/2023, 4:05 PM
    can't do es2 because I need the vertex array stuff
  • b

    bulky-insurance-39338

    05/04/2023, 4:05 PM
    not sure the latest lime is supporting es3 for native yet ( i am remember for android hxcpp there it was on the TODO since longer time )
  • b

    bulky-insurance-39338

    05/04/2023, 4:06 PM
    och, you can also do without VAO .)
  • p

    powerful-morning-89

    05/04/2023, 4:06 PM
    Vertex arrays are not that useful, you'll be fine without them.
  • b

    bulky-insurance-39338

    05/04/2023, 4:07 PM
    yep, what really gives you more performance on ES3 is the -> instance-drawing
  • t

    tall-teacher-57409

    05/04/2023, 4:07 PM
    idk the tutorial I was following used them, so do I just remove the entire vao thing?
  • b

    bulky-insurance-39338

    05/04/2023, 4:08 PM
    yes, try the old way to setup your
    aPos
    attributes
  • b

    bulky-insurance-39338

    05/04/2023, 4:08 PM
    (like into limes SimpleImage sample .. there its also without VAO)
  • h

    hallowed-ocean-84954

    05/04/2023, 4:09 PM
    I did most of the examples without vao s
  • b

    bulky-insurance-39338

    05/04/2023, 4:09 PM
    i am using both .)
  • t

    tall-teacher-57409

    05/04/2023, 4:09 PM
    ok I removed vao and it compiles
  • b

    bulky-insurance-39338

    05/04/2023, 4:10 PM
    ( with that peoteGL-wrapper that what is not available will be eliminated by DCE at the end )
  • t

    tall-teacher-57409

    05/04/2023, 4:10 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 * 4, new Float32Array(vertices), gl.STATIC_DRAW);
    
                    var shader_src = "
                        #version 330 es\n
                                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 = "
                        #version 330 es\n
                                out vec4 FragColor;;\n
    
                                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.vertexAttribPointer(0, 3, gl.FLOAT, false, 3 * 4, 0);
    I can't see the triangle though, is there anything wrong in my code?
  • b

    bulky-insurance-39338

    05/04/2023, 4:12 PM
    yep .. for es2 the glsl-shadercode also don't have to use the
  • b

    bulky-insurance-39338

    05/04/2023, 4:12 PM
    #version 330 es
  • b

    bulky-insurance-39338

    05/04/2023, 4:12 PM
    pragma and also no
    in
    and
    out
  • t

    tall-teacher-57409

    05/04/2023, 4:13 PM

    https://cdn.discordapp.com/attachments/769686258049351722/1103716054053699744/image.png▾

  • t

    tall-teacher-57409

    05/04/2023, 4:13 PM
    💀
  • b

    bulky-insurance-39338

    05/04/2023, 4:14 PM
    😂
  • b

    bulky-insurance-39338

    05/04/2023, 4:15 PM
    also for es2 into fragmentshader it have to be:
    gl_FragColor = vec4(1.0, 0.5, 0.2, 1.0);
  • t

    tall-teacher-57409

    05/04/2023, 4:16 PM
    Copy code
    hx
    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 = "
                                out vec4 FragColor;;\n
    
                                void main()\n
                                {\n
                                    gl_FragColor = vec4(1.0, 0.5, 0.2, 1.0);\n
                                }\n
                    ";
    does that look right now?
  • b

    bulky-insurance-39338

    05/04/2023, 4:17 PM
    Copy code
    glsl
    var frag_shader_src = "
                                void main()\n
                                {\n
                                    gl_FragColor = vec4(1.0, 0.5, 0.2, 1.0);\n
                                }\n
                    ";
  • t

    tall-teacher-57409

    05/04/2023, 4:17 PM
    oh alr
  • b

    bulky-insurance-39338

    05/04/2023, 4:19 PM
    ok, good luck! (have to enter the kitchen to cook for lunch)
1...102103104...138Latest