Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const createContext = require('pex-context')
- const ctx = createContext({ width: 1280, height: 720})
- const drawCmd = {
- pass: ctx.pass({
- clearColor: [0.5, 0.5, 0.5, 1],
- clearDepth: 1
- }),
- pipeline: ctx.pipeline({
- vert: vertSrc,
- frag: fragSrc,
- depthEnabled: true
- }),
- attributes: {
- aPosition: ctx.vertexBuffer(cube.positions),
- aTexCoord: ctx.vertexBuffer(cube.uvs)
- },
- indices: ctx.indexBuffer(cube.cells),
- uniforms: {
- uProjectionMatrix: camera.projectionMatrix,
- uViewMatrix: camera.viewMatrix,
- uModelMatrix: mat4.create(),
- uTexture: ctx.texture2D(img)
- }
- }
- ctx.submit(cmd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement