I've been working on getting the Core profile working under Pyglet.

My framework, PyGLy (very simple, flexible, stays out of your way) includes 
a number of examples.


The simplest one is here:

https://github.com/adamlwgriffiths/PyGLy/blob/master/examples/core/simple/main.py


Uses the scene graph to render a series of cubes.


This uses the core profile.

I also _had_ some example code that was using shaders in the legacy profile 
(fixed function pipeline + shaders), but have not committed this.


Using shaders in legacy is essentially the same as normal rendering.

The only thing I had to look out for was assigning attributes to vertices.

You need to link the shader, then query for the attribute index, then use 
that as the "XgX" format specifier for the vertex_list (assuming you're 
using piglet's vertex list object).

I talked about this here:

https://groups.google.com/forum/?fromgroups=#!topic/pyglet-users/Eonyq0tKR6s


Hope that helps =)


Cheers,

Adam

On Tuesday, September 25, 2012 9:19:39 PM UTC+10, mv wrote:
>
> Hello,
>
> I am looking for a Pyglet example that uses GLSL and the programmable 
> pipeline.
>
> I looked at the Pyglet documentation, but am unable to figure out how to 
> define my own vertex list, and then link that with say, a "attribute vec4 
> pos" variable in the vertex shader.
>
> The examples I have seen use vertex lists, but still use the now 
> deprecated fixed function pipeline. 
>
> I'd appreciate any help with this. 
>
> Regards
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pyglet-users/-/jYu6Kb4OKnwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to