title: SceneKit pass uniform vector to shader modifiers
body: <p>I'm trying to pass a <code>GLKVector4</code> to a shader that should receive it as a <code>vec4</code>. I'm using a fragment shader modifier:</p>
  
  <pre><code>material.shaderModifiers = [ SCNShaderModifierEntryPoint.fragment: shaderModifier ]
  </code></pre>
  
  <p>where <code>shaderModifier</code> is:</p>
  
  <pre><code>// color changes
  uniform float colorModifier;
  uniform vec4 colorOffset;
  
  vec4 color = _output.color;
  
  color = color + colorOffset;
  color = color + vec4(0.0, colorModifier, 0.0, 0.0);
  
  _output.color = color;
  </code></pre>
  
  <p>(I'm simply adding a color offset) I've tried:</p>
  
  <pre><code>material.setValue(GLKVector4(v: (250.0, 0.0, 0.0, 0.0)), "colorOffset")
  </code></pre>
  
  <p>which doesn't work (no offset is added and the shader uses the default value that is (0, 0, 0, 0)). Same happens if I replace <code>GLKVector4</code> by <code>SCNVector4</code></p>
  
  <p>Following <a href="https://stackoverflow.com/questions/30888445/scenekit-shader-modifiers-with-glsl-arrays">this</a> I've also tried:</p>
  
  <pre><code>let points: [float2] = [float2(250.0), float2(0.0), float2(0.0), float2(0.0)]
  material.setValue(NSData(bytes: points, length: points.count * sizeof(float2)), "colorOffset")
  </code></pre>
  
  <p>However, I can pass a float value to the uniform <code>colorModifier</code> easily by doing:</p>
  
  <pre><code>material.setValue(250.0, forKey: "colorModifier")
  </code></pre>
  
  <p>and that will increase the green channel as excepted</p>