Subject: Re: [boost] QVM Review
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2015-12-16 21:51:56
On Wed, Dec 16, 2015 at 1:38 PM, Rainer Deyke <rainerd_at_[hidden]> wrote:
> On 16.12.2015 22:21, Emil Dotchevski wrote:
> > The swizzling syntax must be terse or else it's useless. If you've
> > shader code you'll know utterly inadequate it is to require a syntax like
> > swizzle<1,0,3,2>(vec) instead of (vec,YXWZ). At any rate, swizzling is
> > defined in a separate header, don't include it if you don't want it.
> YXWZ(vec) is not only much more readable than (vec,YXWZ), it's also one
> character shorter.
It's less conventional, in GLSL you just use vec.yxwz, and (vec,YXWZ) is
Also, let's say you want to access the X coordinate of a vector, (vec,X) is
more readable than X(vec).
I do appreciate the concerns about overloading operator comma, I was also
skeptical since this wasn't my idea. FWIW after years of use in actual
development this overload hasn't caused any problems.
That said, I'm fine with using a different notation for swizzling.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk