共用方式為


Mesh.SetColorUniform Method

Definition

Overloads

SetColorUniform(String, Color)

Sets the uniform color value corresponding to the shader assigned to the mesh.

SetColorUniform(String, ColorObject)

Sets the uniform color value corresponding to the shader assigned to the mesh.

SetColorUniform(String, Int64)

Sets the uniform color value corresponding to the shader assigned to the mesh.

SetColorUniform(String, Color)

Sets the uniform color value corresponding to the shader assigned to the mesh.

[Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;I)V", "GetSetColorUniform_Ljava_lang_String_IHandler", ApiSince=34)]
public virtual void SetColorUniform (string uniformName, Android.Graphics.Color color);
[<Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;I)V", "GetSetColorUniform_Ljava_lang_String_IHandler", ApiSince=34)>]
abstract member SetColorUniform : string * Android.Graphics.Color -> unit
override this.SetColorUniform : string * Android.Graphics.Color -> unit

Parameters

uniformName
String

name matching the color uniform declared in the shader program.

color
Color

the provided sRGB color will be converted into the shader program's output colorspace and be available as a vec4 uniform in the program.

Attributes

Remarks

Sets the uniform color value corresponding to the shader assigned to the mesh. If the shader does not have a uniform with that name or if the uniform is declared with a type other than vec3 or vec4 and corresponding layout(color) annotation then an IllegalArgumentExcepton is thrown.

Java documentation for android.graphics.Mesh.setColorUniform(java.lang.String, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetColorUniform(String, ColorObject)

Sets the uniform color value corresponding to the shader assigned to the mesh.

[Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;Landroid/graphics/Color;)V", "GetSetColorUniform_Ljava_lang_String_Landroid_graphics_Color_Handler", ApiSince=34)]
public virtual void SetColorUniform (string uniformName, Android.Graphics.ColorObject color);
[<Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;Landroid/graphics/Color;)V", "GetSetColorUniform_Ljava_lang_String_Landroid_graphics_Color_Handler", ApiSince=34)>]
abstract member SetColorUniform : string * Android.Graphics.ColorObject -> unit
override this.SetColorUniform : string * Android.Graphics.ColorObject -> unit

Parameters

uniformName
String

name matching the color uniform declared in the shader program.

color
ColorObject

the provided sRGB color will be converted into the shader program's output colorspace and will be made available as a vec4 uniform in the program.

Attributes

Remarks

Sets the uniform color value corresponding to the shader assigned to the mesh. If the shader does not have a uniform with that name or if the uniform is declared with a type other than vec3 or vec4 and corresponding layout(color) annotation then an IllegalArgumentExcepton is thrown.

Java documentation for android.graphics.Mesh.setColorUniform(java.lang.String, android.graphics.Color).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetColorUniform(String, Int64)

Sets the uniform color value corresponding to the shader assigned to the mesh.

[Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;J)V", "GetSetColorUniform_Ljava_lang_String_JHandler", ApiSince=34)]
public virtual void SetColorUniform (string uniformName, long color);
[<Android.Runtime.Register("setColorUniform", "(Ljava/lang/String;J)V", "GetSetColorUniform_Ljava_lang_String_JHandler", ApiSince=34)>]
abstract member SetColorUniform : string * int64 -> unit
override this.SetColorUniform : string * int64 -> unit

Parameters

uniformName
String

name matching the color uniform declared in the shader program.

color
Int64

the provided sRGB color will be converted into the shader program's output colorspace and be available as a vec4 uniform in the program.

Attributes

Remarks

Sets the uniform color value corresponding to the shader assigned to the mesh. If the shader does not have a uniform with that name or if the uniform is declared with a type other than vec3 or vec4 and corresponding layout(color) annotation then an IllegalArgumentExcepton is thrown.

Java documentation for android.graphics.Mesh.setColorUniform(java.lang.String, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to