[Bf-committers] Viewport FX Design

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Jun 1 14:59:46 CEST 2012


On Fri, Jun 1, 2012 at 1:54 PM, Jason Wilkins <jason.a.wilkins at gmail.com> wrote:
> On Fri, Jun 1, 2012 at 5:28 AM, Brecht Van Lommel
> The reason is because you could just directly address the matrix you
> want to use.  It would be a more object oriented interface that does
> not rely on global state to know which matrix to address.

I can imagine an API where every matrix function specifies which of
the 3 standard matrices it works on. If that's better or not I don't
have a strong opinion, nearly all modifications are to the modelview
matrix anyway, so there isn't much matrix mode switching.

>> * "An option to separate modelview into "model" and "view" matrices
>> which remain valid until you change the modelview directly."
>>
>> Also don't understand this, to me it seems the model and view
>> separation is nicely handled by matrix stacks.
>
> Think about instanced geometry, if you move the camera you would have
> to update all of their modelview matrices.  If you do the model * view
> transformation in the vertex shader you only have to update view
> matrix.  Including the view and model matrices in the same stack is
> based on the assumption that people would be using glBegin/glEnd to
> send geometry every frame.

If we are talking about a situation where the matrix is retained on
the GPU, then it indeed makes sense to have this separation. Also for
shaders it probably makes sense, more advanced GLSL code needs
separate access to these.

Though if this is about a matrix retained on the GPU, then the API for
that would be quite different, I don't think it would be a matrix
mode, but some sort of handle associated with Blender objects.

>> * "Concatenate transformations to the top or bottom."
>>
>> I can't think of a situation where this would be a good thing to do.
>> It means you have to know something about what happened below in the
>> stack, if you follow the GL rules any transformation is nicely
>> 'local'.
>
> I've written code many times where I needed to glGetFloat, add a
> transformation to the beginning, then put the matrix back.  Having the
> option to separate the model and view matrix probably eliminates that
> pattern though because that is all I ever used that kind of thing for.

I still can't think of any such situation, but maybe I'm
misunderstanding what you mean here.

Brecht.


More information about the Bf-committers mailing list