Showing posts with label OpenGL. Show all posts
Showing posts with label OpenGL. Show all posts

Tuesday, December 22, 2015

Multisample Antialiasing for FxPlugs

I finally implemented OpenGL Multisample Antialiasing in the context of an Apple FxPlug project. Took me a lot of time to figure this one out (why is it so hard to find clear implementation details on MSAA?). I hope I can save someone else the pain:

https://github.com/bbattey/MSAA-for-FxPlugs




Saturday, December 19, 2015

Kochanek Bartels Spline Class for Objective-C + OpenGL

A Kochanek Bartels spline is a lovely, flexible means for casting a curve through multiple points, and providing artistically useful control over the character of the curve. It is also known as a TCB spline, because the controls are Tension, Continuity, and Bias. It was originally developed for providing smooth keyframed animation control curves, but it is also useful for general graphics purposes. For one of my Apple Motion FxPlug projects, I developed a Objective C class to render a Kochanek Bartels spline in OpenGL. It includes an additional feature of interpolating colors between the target points.

 

I have placed the code on GitHub. Corrections/improvements welcomed.

And here's a taste of what happens if one sets the parameters outside of the standard -1 to 1 range. Here T = -4.38, C = -1.31, and B = 0.37:






Tuesday, December 9, 2014

Avoiding __psynch_mutexwait in glBegin

The following code in a Mac openFrameworks project was hanging occasionally when I controlled the point size via a slider box (graphic card = AMD FirePro D500):

glPointSize(scaledPointSize);
glBegin(GL_POINTS);

resulting in a hang in __psynch_mutexwait inside glBegin.
The hang doesn't arise as long as I don't let scaledPointSize exceed 30. So that is a fix — of sorts.