Sign in to follow this  

How do you use bvecs (GLSL) ?

Recommended Posts

TysonJ    145
I'm confused about bvecs. What can you do with them? Is their only use in the expressions if (any(bvec)) and if (all(bvec))?

I would like to efficiently generate a vector B from another vector A, where B.n is 1. if n is the largest component of A, and 0. otherwise.
so {0.1, 0.2, 0.8., 0.} -> {0., 0., 1., 0.}

I would [i]like [/i]to do something like (greaterThan(A, A.yzwx) & greaterThan(A, A.zwxy) & greaterThan(A, A.wxyz)).ToFVec()... but of course it doesn't work that way... Edited by TysonJ

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this