On Fri, Nov 3, 2017 at 1:26 PM, nick ralabate via swift-evolution <
swift-evolution@swift.org> wrote:
> I think it would be helpful for graphics programmers to specify vertex
> data inline without surrounding every value with Float(4.0).
>
Two pointers:
a. You never actually want to write
> On Nov 3, 2017, at 3:33 PM, Kelvin Ma wrote:
>
>
>
> On Fri, Nov 3, 2017 at 2:05 PM, Steve Canon via swift-evolution
> > wrote:
> If/when 16b floats were added to the standard lib, you would just write:
>
On Fri, Nov 3, 2017 at 2:05 PM, Steve Canon via swift-evolution <
swift-evolution@swift.org> wrote:
> If/when 16b floats were added to the standard lib, you would just write:
>
> let vertexData: [Float16] = [ 1, 0, 0.5, 1 ]
>
> I should note that something like vertex coordinates is usually
If/when 16b floats were added to the standard lib, you would just write:
let vertexData: [Float16] = [ 1, 0, 0.5, 1 ]
I should note that something like vertex coordinates is usually better modeled
with a more specific type than [Float], like SCNVector4 or simd.float4 or your
own type,
You can write this for the first thing that you want:
let vertexData: [Float] = [1.0, 0.0, 0.5, 1.0]
I don't know enough about 16-bit floats to comment on those.
On Fri, Nov 3, 2017 at 11:26 AM nick ralabate via swift-evolution <
swift-evolution@swift.org> wrote:
> I think it would be
I think it would be helpful for graphics programmers to specify vertex data
inline without surrounding every value with Float(4.0).
Something like this:
let vertexData = [ 1.0f, 0.0f, 0.5f, 1.0f ]
Also, it would be great if Swift had a type for half-floats to match the
iPhone GPU:
let