Re: FxPlug / OpenGL Smooth Line Artifact
Re: FxPlug / OpenGL Smooth Line Artifact
- Subject: Re: FxPlug / OpenGL Smooth Line Artifact
- From: Darrin Cardani <email@hidden>
- Date: Mon, 20 Oct 2008 10:03:09 -0700
On Oct 17, 2008, at 5:56 PM, George King wrote:
On Oct 17, 2008, at 5:12 PM, Darrin Cardani wrote:
On Oct 17, 2008, at 5:10 PM, George King wrote:
glClearColor(1,1,1,1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I think the above is your problem. Since colors in OpenGL are
already premultiplied, I think you want to use:
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
That fixes my test case, but unfortunately it introduces a similar
problem elsewhere. Now my lines are getting white 'feathers' instead
of black. Below is a screenshot from my project; I'll have to work
at a better test case.
Without knowing how you drew what's in the screenshot, it's hard to
say what the problem could be.
Remember that using (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) works
fine in a fresh NSOpenGLContext.
How are you creating the NSOpenGLContext?
I'm not sure what you mean about premultiplication. My limited
understanding of that term is that when a function requires
premultiplied color data, the color must multiply each color
component by the alpha component ahead of time. So the quadruple for
100% red at 50% transparency is (.5, 0, 0, .5).
Yes, that's correct.
When I want that color in OpenGL I call glColor4f(1, 0, 0, .5).
Please let me know if I am misunderstanding the concept.
I think you're understanding it correctly. I was under the impression
(though I may be wrong) that you specify colors using straight alpha,
but internally, OpenGL premultiplies them. Maybe I'm wrong about that.
Needless to say, though, Motion and FCP do expect your plugin to
produce premultiplied output, and they give you premultiplied input.
Darrin
--
Darrin Cardani
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden