To sum up (sorry, 3 emails).

If you want core profile, the only thing you can use pyglet for is events 
and the window itself.
You need to provide the rest.

However, like I said before. I'm either going to provide my own classes in 
pygly, or work on pyglet to add this functionality.

Adam

On Wednesday, September 26, 2012 1:40:02 PM UTC+10, Adam Griffiths wrote:
>
> I just read your post a bit more thoroughly, sorry, in a rush today.
>
> Pyglet's code uses legacy calls. If you're using Core profile only with no 
> compatibility, you'll need to do your own vertex arrays.
> I'm running on OS-X and I'm unable to mix legacy and core.
>
> I've got an example that uses Core VBO and VAO calls.
> It includes everything needed to render the cube, apart from the matrices 
> themselves which are in simple.py I posted earlier.
> https://github.com/adamlwgriffiths/PyGLy/blob/master/examples/core/cube.py
>
> This file also uses vertex attributes to specify colour:
>
> https://github.com/adamlwgriffiths/PyGLy/blob/master/examples/core/colour_cube.py
>
> I'm currently looking into either writing my own classes to use in PyGLy, 
> or updating pyglet to enable core profile usage in these key classes 
> (texture, label, vertex_list).
>
> Take a gander around my PyGLy repository.
>
> I've also got a GLSL shader I'm working on atm (it works, just want to 
> clean up the API) that does hardware animation / interpolation of MD2 mesh 
> formats (yes, old, but simple).
>
> https://github.com/adamlwgriffiths/Razorback/blob/master/razorback/md2/data.py
>
> This should give you enough info.
>
> The code is long, but its clear and I don't remove any boiler plate.
> So the code you want to look at is:
> pygly/shader.py
> examples/application.py
> examples/core/application.py
> examples/core/simple/main.py
> examples/core/cube.py
> examples/core/colour_cube.py
>
>
> Cheers,
> Adam
>
>
> On Wednesday, September 26, 2012 1:33:39 PM UTC+10, Adam Griffiths wrote:
>>
>> 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/-/Gjx8dWHW4MEJ.
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