Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glsl-extract

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-extract

extract uniforms and attributes from glsl programs

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

glsl-extract

extract attribute and uniform data from glsl files, no matter how nested.

var extract = require('glsl-extract')

extract(fs.createReadStream('test.glsl'))(function(err, info) {
  {attributes, uniforms} = info
  for(var def of uniforms) {
    {name, type} = def  // where "name" is the full dotted, array'd
                        // gl.getUniformLocation lookup path and
                        // type is the declared type.
  }
})

extract("also works with just text")(function(err, info) {
  // should execute on same frame.
})

api

extract(ReadableStream | String | Buffer[, getContextFunction) -> Continuable

Given a readable stream, string, or buffer, return a continuable that will trigger parsing. The continuable will call its callback with err (if any), and data, where data is comprised of {attributes:[GLSLLocation], uniforms:[GLSLLocation]}.

GLSLLocation

A GLSLLocation is just a plain object containing name (the appropriate name to pass to gl.getUniformLocation) and type (one of the primitive GLSL types).

license

MIT

Keywords

FAQs

Package last updated on 05 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc