I'm not sure it's worthwhile to include *at all*. What's the advantage of
doing that, versus transforming the model on the GPU?

Matrix * vector operations in the vertex shader are really cheap, and most
programs are limited by the fragment shader performance.

The only case where this might be a win is if you are assembling a level
from singular geometries at runtime. Which seems a vanishingly unlikely
case - generally you would assemble static elements in your editor, and
then add multiple copies of props, etc at runtime.
On Tue, Jun 6, 2017 at 00:29, Benjamin Moran <[email protected]> wrote:

>
>
>> ISTM that gross operations on the model (transformations on all vertices
>> like the translation - I think that's what you mean by "shifting the
>> model") should be handled entirely by a shader, and no actual vertex data
>> manipulation, since setting the shader variable will be infinitely faster.
>>
>>
>>      Richard
>>
>> Yes, sorry, I do mean translation. And you're absolutely right that it's
> silly to do these types of transformations on the CPU in a realtime
> application.
> I was mainly thinking that it's useful to have transform methods to
> reposition static objects in the scene when you first load them.
> I think the only possibilities are passing arguments to the
> pyglet.model.load function, or doing it right after loading. If you do it
> after loading, the following three methods should cover most bases:
> Model.update(x, y, z)     # Translate on a specific axis.
> Model.scale(1.0)          #  Rescale the entire model.
> Model.rotate(x, y, z)     #  Rotate along one or more axis.
>
> This would come with a big fat warning about not doing this every frame,
> and of course using shaders is going to be necessary for most things.
> Does that sound reasonable?
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/pyglet-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to