Quote:So far all I've got is a whole bunch of ideas, and a passing knowledge of how the current PGraphicsGL works, and what it does natively, and what it forks off to PGraphics3. Not actually written anything other than a test to get pure GL lighting.
From my investigations, the lighting is almost entirely useable, it just needs the PG3 parts culling, and versions writing that do no matrix munging.
The vertex stuff is similar, except GL has a native QUAD mode so quads don't need to be triangulated, and again the matrix stuff needs to go bye-bye. Also the vertex colour stuff needs a tweak, to get ambient/specular/shininess working properly for GL, not having PG3 work out the vertex colour beforehand.
camera/frustrun/perspective/translate/rotate/scales et al need converting to gl equivalents, but I think there's a fairly simple mapping. (e.g. gluLookAt/glVertexf/glRotatef) for most.
All the texture stuff is probably fine, but maybe in the translation the image corruption stuff might get sorted.
generally it's easy to map the first 70 or 80%, but there's a nasty remaining bit that is quite a headache, which is why i'm not doing this by default in PGraphicsGL. obviously i'd much prefer that everything was native calls to GL, but to properly support 100% of the p5 api, it gets very messy. since you're not doing the base GL class for everyone, you have the luxury of leaving out some bits.
for instance, beginShape() with with a fill() and QUADS maps to the GL call. but what happens when you want a stroke() in there as well? you have to make the set of calls twice. which isn't a big deal but starts getting pretty messy for the list of all the gl calls to support.
later, getting lighting to match between P3D and OPENGL is a considerable headache (i think there are notes about this in the javadocs).
as for the minimum set of methods, it's essentially the set of public methods in the PGraphics object. the PMethods.java file is and empty source file but contains my notes on what the api looked like, though i think it's now out of date (and soon to disappear from svn). look at PApplet for everything that gets a g.whatever() method added to the end (the auto-generated stuff). and if you have questions about whether one thing or another needs to be included, just ask.