XML Feeds

.

[jitter] Re: jxs shaders in jit.gl.lua?

Wesley Smith wesley.hoke at gmail.com
Sun Feb 3 20:16:24 MST 2008


Multiple bindings of shaders or not available on any hardware.  There
can only be one shader at a time running on the GPU.  You can however
have multiple compiled shaders that you bind at different times.

wes

On Feb 3, 2008 6:16 PM, Keith Manlove <keithmanlove at gmail.com> wrote:
> Hey Wesley,
>
> I'm not around my computer to try it, but are multiple bindings
> available?
>
> Keith
>
> On Feb 3, 2008, at 1:24 PM, "Wesley Smith" <wesley.hoke at gmail.com>
> wrote:
>
>
> > This is how you use shaders.  You just make a shader object and call
> > its bind methods.
> > wes
> >
> >
> > shader = jit.new("jit.gl.shader", this.drawto)
> > shader.file = "cc.brcosa.jxs" --shader file to load
> >
> > function draw()
> >
> >
> > shader:bind()
> >
> > gl.Begin("QUADS")
> > --top left
> > gl.TexCoord(0., 1.)
> > gl.Vertex(-0.5, 0.5, 0.)
> >
> > --bottom left
> > gl.TexCoord(0., 0.)
> > gl.Vertex(-0.5, -0.5, 0.)
> >
> > --bottom right
> > gl.TexCoord(1., 0.)
> > gl.Vertex(0.5, -0.5, 0.)
> >
> > --top right
> > gl.TexCoord(1., 1.)
> > gl.Vertex(0.5, 0.5, 0.)
> > gl.End()
> >
> > shader:unbind()
> >
> > end
>
> > _______________________________________________
> > jitter mailing list
> > jitter at cycling74.com
> > http://www.cycling74.com/mailman/listinfo/jitter
> _______________________________________________
> jitter mailing list
> jitter at cycling74.com
> http://www.cycling74.com/mailman/listinfo/jitter
>


More information about the jitter mailing list