[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] GLSL Texturing example ? (and ctypes...?)



JoN wrote:

Just thought you might like to know that all works beautifully, thanks!

Couple of interesting points.

It worked even before these actions:



   texture_param = glGetUniformLocation(program, "texture");

Set the sampler to use the first texture unit (0):
   glUseProgram(program)
   glUniform1i(texture_param, 0);
   glutSolidTeapot(1.0)




-were added in. I'm not sure why, default behaviour ?


I'm assuming you still had glUseProgram in there ;-) I suppose if you don't set the value of a uniform parameter it defaults to zero anyway (first texture unit), so yeah, cool.

Also - when the teapot spins round and presents either the handle or the spout
close to the viewplane (the spout gets clipped), there is noticeable slowdown.


I don't get that.. pretty consistent 700 FPS at all angles. I'm on a 6600 GT with 1.0-9625 beta driver.

And lastly - even in the basic demo, using position vectors as colours, the
perspective of the teapot is strange, it seems a bit 'fisheye' as it rotates
around, almost allowing both the spout and the handle to hide behind the body of
the pot together - but I am assuming this is because this is very basic
projection code.


This has 90 degree FOV...
   gluPerspective(90.0, width/float(height), 1.0, 100.0)

I think most FPS's use around 60 degrees, see if you like that better.

All that's for later on, this is under glX on Fedora Core 3 with a Quadra and
the latest Nvidia drivers - any strangeness could be due to _anything_ at this
stage, so I wont put the cart before the horse just yet. I'm just really glad
to have it running!


Don't know what a Quadra is (Quadro?). nvidia drivers will emulate anything in software if your hardware doesn't support it. That would be the case if you're getting framerates less than 100 on this demo. Might want to also check that you're actually loading the nvidia driver, not the open source one, or (worse) Mesa. Fedora can be a bit finicky about this in my experience.

Alex.