Giter Site home page Giter Site logo

Comments (5)

nphollon avatar nphollon commented on June 25, 2024

Looking at the cube.elm example:

vertexShader : Shader { attr | position:Vec3, color:Vec3 } { unif | rotation:Mat4, perspective:Mat4, camera:Mat4 } { vcolor:Vec3 }

The first record specifies that "position" and "color" are your attributes. Within your GLSL code, these are defined as attributes. Within your Elm code, your "Vertex" type needs to have these defined as fields.

If you wanted to define a new attribute, you would need to change the signature for vertexShader, and add a field to the Vertex type definition.

from elm-webgl.

7sharp9 avatar 7sharp9 commented on June 25, 2024

Oh I can understand that part, its more how would you add interleaved vertex buffers, index buffers, and things like setting a subtexture.

I guess Im just missing a few more examples to grasp the mapping from js based webgl and the elm wrapper.

from elm-webgl.

nphollon avatar nphollon commented on June 25, 2024

It sounds like you might be looking for a finer level of control than the Elm API gives you. There is no Elm counterpart to vertex or index buffers. You pass you attributes to render, and the library decides how to arrange the data in memory.

from elm-webgl.

7sharp9 avatar 7sharp9 commented on June 25, 2024

I was hoping there would be some middle ground where vertex and index buffers could be used.

from elm-webgl.

nphollon avatar nphollon commented on June 25, 2024

What are you trying to accomplish? If you tell us more details about your use case, we may be able to help.

It doesn't sound like there is anything actionable that is related to the original topic, so I am going to close this issue.

from elm-webgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.