public void CopyFrom(IUniformValue source) { foreach (var f in array) { f.CopyFrom(source); } } // also IUniformValue
public void Set(IUniformValue source) { UniformValueInt1 other = source as UniformValueInt1; if (other == null) { return; } X = other.X; }
public bool GetUniformValue(UniformUsage usage, out IUniformValue value) { value = null; if (usage == UniformUsage.World) { value = UniformValue.Create(World); } else if (usage == UniformUsage.WorldView) { if (_camera != null) { value = UniformValue.Create(Matrix4.Mult(World, _camera.View)); } else { value = UniformValue.Create(World); } } else if (usage == UniformUsage.WorldViewProj) { if (_camera != null) { value = UniformValue.Create(Matrix4.Mult(World, _viewProjection)); } else { value = UniformValue.Create(World); } } else if (usage == UniformUsage.ViewPort) { if (_camera != null) { value = UniformValue.Create(_camera.Viewport.GetAsVector4()); } else { value = UniformValue.Create(new Vector4(0, 0, Width, Height)); } } else if (usage == UniformUsage.NearFar) { if (_camera != null) { value = UniformValue.Create(new Vector2(_camera.Near, _camera.Far)); } else { value = UniformValue.Create(new Vector2(1f, 100f)); } } return(value != null); }
public void AddShaderUniform(string shader, string uniform, IUniformValue value) { Dictionary <string, IUniformValue> shaderDict; if (!ShaderUniforms.TryGetValue(shader, out shaderDict)) { shaderDict = new Dictionary <string, IUniformValue>(); ShaderUniforms[shader] = shaderDict; } shaderDict[uniform] = value; }
public void Set(IUniformValue source) { UniformValueFloat2 other = source as UniformValueFloat2; if (other == null) { return; } X = other.X; Y = other.Y; }
public void Set(IUniformValue source) { UniformValueMatrix other = source as UniformValueMatrix; if (other == null) { return; } M = other.M; transpose = other.transpose; }
public void Set(IUniformValue source) { UniformValueInt3 other = source as UniformValueInt3; if (other == null) { return; } X = other.X; Y = other.Y; Z = other.Z; }
public void Set(IUniformValue source) { UniformValueUint4 other = source as UniformValueUint4; if (other == null) { return; } X = other.X; Y = other.Y; Z = other.Z; W = other.W; }
void SetUniform(string name, IUniformValue uniformValue) { bool same = false; if (_uniformValues.ContainsKey(name)) { same = _uniformValues[name].Equals(uniformValue); _uniformValues[name] = uniformValue; } else { _uniformValues.Add(name, uniformValue); } // Do not attempt to set uniform for invalid shaders if (!same && _valid) { uniformValue.Set(_handle, GetUniformLocation(name)); } }
public void CopyFrom(IUniformValue src) { TextureRL other = (TextureRL)src; textureObject = other.textureObject; }
public bool Equals(IUniformValue other) { return(Equals((object)other)); }