On Nov 1, 2:51 pm, B W <[email protected]> wrote: > On Sun, Oct 31, 2010 at 4:50 PM, Jonathan Hartley <[email protected]>wrote: > > > For the record, I'm working through these pyopengl tutorials right > > now. In case anyone else with old hardware is considering it, you > > should know: > > > It's all been plain sailing up until the seventh tutorial, which adds > > multiple light sources: > >http://pyopengl.sourceforge.net/context/tutorials/shader_7.xhtml > > > I'm stuck on number 4. My problem is with the shader code, which operates > > on the same color buffer for both sets of vertices. This doesn't fit in a > consolidated batch paradigm. Not entirely stuck; I'm thinking now two > batches will be needed, or two shaders. (Or maybe I'll just skip this one, > which appears would be best solved as it is. It is conceptual, not something > I envision doing in a real application.) > > Did you convert these examples to Pyglet batches, Jonathon? I'm curious to > see what you've accomplished. > > Gumm
Hey Gumm. No, I haven't been converting the tutorials to pyglet batches. I've been sticking fairly closely to the original pyopengl tutorial source. My source is all here: https://bitbucket.org/tartley/tutorials/src/tip/pyopengl/ The only substantive changes I've made are: a) remove use of arrays, as previously mentioned b) Alter the parameter values used to initialise lights, from tutorial 6 onward. I probably made a mistake in typing / copying the tutorial code, but I made change (b) because the once the tutorials introduce specular highlights, the lighting parameters produce strange-looking results for me. The ambient and diffuse terms are so low the the sphere is practically black if I turn off specular highlights. I boosted these terms from around 0.1 to around 0.6, in materials and lighting. Plus, the specular highlight itself is massive, covering a full half of the sphere. Does anyone else see this? Or did I just break the tutorial code somehow? I reduced the specular highlight size by changing the material shininess from 0.995 to 50. This produced a result much more in keeping with what I was expecting to see. All three components of the lighting (ambient, diffuse and specular) are now clearly visually distinguishable. I also made the material's specular color equal to white, and made each light source's color closer to white, just to give a more 'real-world' looking image. Jonathan -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. 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.
