@@ -4267,58 +4267,13 @@ class FragmentShader extends Shader {
4267
4267
Float32List _floats = _kEmptyFloat32List;
4268
4268
4269
4269
/// Sets the float uniform at [index] to [value] .
4270
- ///
4271
- /// All uniforms defined in a fragment shader that are not samplers must be
4272
- /// set through this method. This includes floats and vec2, vec3, and vec4.
4273
- /// The correct index for each uniform is determined by the order of the
4274
- /// uniforms as defined in the fragment program, ignoring any samplers. For
4275
- /// data types that are composed of multiple floats such as a vec4, more than
4276
- /// one call to [setFloat] is required.
4277
- ///
4278
- /// For example, given the following uniforms in a fragment program:
4279
- ///
4280
- /// ```glsl
4281
- /// uniform float uScale;
4282
- /// uniform sampler2D uTexture;
4283
- /// uniform vec2 uMagnitude;
4284
- /// uniform vec4 uColor;
4285
- /// ```
4286
- ///
4287
- /// Then the corresponding Dart code to correctly initialize these uniforms
4288
- /// is:
4289
- ///
4290
- /// ```dart
4291
- /// void updateShader(Shader shader, Color color, ImageShader sampler) {
4292
- /// shader.setFloat(0, 23); // uScale
4293
- /// shader.setFloat(1, 114); // uMagnitude x
4294
- /// shader.setFloat(2, 83); // uMagnitude y
4295
- ///
4296
- /// // Convert color to premultiplied opacity.
4297
- /// shader.setFloat(3, color.red / 255 * color.opacity); // uColor r
4298
- /// shader.setFloat(4, color.green / 255 * color.opacity); // uColor g
4299
- /// shader.setFloat(5, color.blue / 255 * color.opacity); // uColor b
4300
- /// shader.setFloat(6, color.opacity); // uColor a
4301
- ///
4302
- /// // initialize sampler uniform.
4303
- /// shader.setSampler(0, sampler);
4304
- /// }
4305
- /// ```
4306
- ///
4307
- /// Note how the indexes used does not count the `sampler2D` uniform. This
4308
- /// uniform will be set separately with [setSampler] , with the index starting
4309
- /// over at 0.
4310
- ///
4311
- /// Any float uniforms that are left uninitialized will default to `0` .
4312
4270
void setFloat (int index, double value) {
4313
4271
assert (! debugDisposed, 'Tried to accesss uniforms on a disposed Shader: $this ' );
4314
4272
_floats[index] = value;
4315
4273
}
4316
4274
4317
4275
/// Sets the sampler uniform at [index] to [sampler] .
4318
4276
///
4319
- /// The index of the setSampler is the index of the sampler uniform defined
4320
- /// in the fragment program, excluding all non-sampler uniforms.
4321
- ///
4322
4277
/// All the sampler uniforms that a shader expects must be provided or the
4323
4278
/// results will be undefined.
4324
4279
void setSampler (int index, ImageShader sampler) {
0 commit comments