Coder Social home page Coder Social logo

gl-shader's People

Contributors

andyinabox avatar archmoj avatar gre avatar hughsk avatar lejeunerenard avatar mattdesl avatar mikolalysenko avatar monfera avatar tatumcreative avatar wwwtyro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gl-shader's Issues

expose uniforms/attributes types?

Hi @mikolalysenko ,

first of all, thanks a lot for making this library, it is very smooth!
I'm working on glsl-transition and I've chosen to depend on your awesome webgl wrapper.

There is one thing I need which is not exposed by your library: getting the original types of uniforms (basically those which are given by glsl-exports).

My use-case is the following: I want to dynamically allocate textures for sampler2D uniforms.

Any idea how we could do that? Should we introduce a new field property on a Shaders like shader.types = { uniforms: uniforms, attributes: attributes } ?

Best regards,
@gre

PS: I'm also the creator of the (now old) 'glsl.js' library, and I can say that your library is 10x smoother than mine (I was doing regexp to parse the glsl, can you believe that!), I'm also probably going to refactor it basing it on yours (just keeping the same API).

Shader not woking on android device with gl-react-native

I am using gl-react and gl-react-native in my react-native app
It is working fine on IOS but return error on android

error like this
"gl-shader: Error compiling shader: compile failed."
"Compilation errors. No Code generated."

I am really much of time spend for this to working
Any help will be appreciated

Thanks!

Make the code more CSP friendly

The current version use the Function constructor which make the code incompatible with a secure CSP.

https://github.com/stackgl/gl-shader/blob/master/lib/create-uniforms.js#L9 :
For example:

//Binds a function and returns a value
function identity(x) {
  var c = new Function('y', 'return function(){return y}')
  return c(x)
}

Could probably be replaced by something like:

//Binds a function and returns a value
function identity(x) {
  return function (){return x}
}

The two only other functions using Function are makeGetter and makeSetter.

Related: plotly/plotly.js#897

(sorry @mikolalysenko I feel like I spam you but it's just a coincidence if it's again one of your repository! And I think it's important to document which code can or cannot be used in a secure manner in a browser)

Outdated README with glslify

I'm having trouble parsing some of what's in the readme, mainly with how this module was much tighter coupled to the older version of glslify.

var shader = createShader(vertexSource, fragmentSource[, uniforms, attributes])
...
The format of uniforms and attributes is consistent with glslify's output

I'm not sure what this format looks like and what exactly these are supposed to do when you feed them in.

var shader = createShader(gl, glslifyResult)

Also this says to take the glslify result, which is no longer relevant. Or if that formatting is relevant, it's not clear how to use it with how glslify has changed.

Sneaky bug w/ attribute caching it seems

Getting weird results on the first frame of rendering using a typical setup with gl-geometry + gl-shader and some attributes for position, normal. The first frame gl-geometry sets up the attribute locations accordingly, but it isn't until the second frame that they seem to "kick in." This is a problem for GL apps that only need to be run once (e.g. render scene to texture).

Will keep poking around.

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.