Comments (5)
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.
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.
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.
I was hoping there would be some middle ground where vertex and index buffers could be used.
from elm-webgl.
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)
- Repository field in elm-package.json affects correctness of generated Javascript HOT 2
- Drop elm- from package name
- Extract a task to load image into separate project
- Unify code formatting in the Native module HOT 2
- Add support to disable premultipliedAlpha HOT 7
- Examples lead to 404 HOT 2
- Package hardwired to elm-lang/core 4.0.0
- Nothing gets rendered until the program receives it's first message HOT 2
- JS Interop: Direct Access to "draw()"? HOT 5
- Interactivity: Picking HOT 5
- Host examples on gh-pages? HOT 24
- Exploding textures cache HOT 1
- Support the advanced mode of google closure compiler HOT 3
- Provide the ability to load a texture without an implicit UNPACK_FLIP_Y_WEBGL HOT 1
- Provide the ability to render a mesh with supplied vertices and indices.
- Adding Elm 0.18 HOT 4
- Publish a version with deprecation notice
- Respect Evan's constraints on this package HOT 6
- Broken link in README HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-webgl.