| 153 | } |
| 154 | |
| 155 | set() { |
| 156 | const v = this.value; |
| 157 | |
| 158 | if (defined(v.red)) { |
| 159 | if (!Color.equals(v, this._value)) { |
| 160 | this._value = Color.clone(v, this._value); |
| 161 | this._gl.uniform3f(this._location, v.red, v.green, v.blue); |
| 162 | } |
| 163 | } else if (defined(v.x)) { |
| 164 | if (!Cartesian3.equals(v, this._value)) { |
| 165 | this._value = Cartesian3.clone(v, this._value); |
| 166 | this._gl.uniform3f(this._location, v.x, v.y, v.z); |
| 167 | } |
| 168 | } else { |
| 169 | //>>includeStart('debug', pragmas.debug); |
| 170 | throw new DeveloperError( |
| 171 | `Invalid vec3 value for uniform "${this.name}".`, |
| 172 | ); |
| 173 | //>>includeEnd('debug'); |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | /////////////////////////////////////////////////////////////////////////// |