docs/android/dokka/filament-android/com.google.android.filament/-material/set-default-parameter.md
//filament-android/com.google.android.filament/Material/setDefaultParameter
[main]
open fun setDefaultParameter(name: String, x: Boolean)
Sets the value of a bool parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the material parameter |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Float)
Sets the value of a float parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the material parameter |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Int)
Sets the value of an int parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the material parameter |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Boolean, y: Boolean)
Sets the value of a bool2 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Float, y: Float)
Sets the value of a float2 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Int, y: Int)
Sets the value of an int2 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Boolean, y: Boolean, z: Boolean)
Sets the value of a bool3 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)
Sets the value of a float3 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Int, y: Int, z: Int)
Sets the value of a int3 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Boolean, y: Boolean, z: Boolean, w: Boolean)
Sets the value of a bool4 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| w | the value of the fourth component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)
Sets the value of a float4 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| w | the value of the fourth component |
| Material |
[main]
open fun setDefaultParameter(name: String, x: Int, y: Int, z: Int, w: Int)
Sets the value of a int4 parameter on this material's default instance.
main
| name | the name of the material parameter |
| x | the value of the first component |
| y | the value of the second component |
| z | the value of the third component |
| w | the value of the fourth component |
| Material |
[main]
open fun setDefaultParameter(name: String, type: MaterialInstance.BooleanElement, v: Array<Boolean>, offset: Int, count: Int)
Set a bool parameter array by name.
main
| name | name of the parameter array as defined by this Material |
| type | the number of components for each individual parameter |
| v | array of values to set to the named parameter array |
| offset | the number of elements in v to skip |
| count | the number of elements in the parameter array to set |
| For example, to set a parameter array of 4 bool4s: |
boolean[] a = new boolean[4 * 4]; material.setDefaultParameter("param", MaterialInstance.BooleanElement.BOOL4, a, 0, 4);
``` |
#### See also
| |
|---|
| [Material](get-default-instance.md) |
[main]\
open fun [setDefaultParameter](set-default-parameter.md)(name: [String](https://developer.android.com/reference/kotlin/java/lang/String.html), type: [MaterialInstance.IntElement](../-material-instance/-int-element/index.md), v: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-array/index.html)<[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-int/index.html)>, offset: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-int/index.html), count: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-int/index.html))
Set an int parameter array by name.
#### Parameters
main
| | |
|---|---|
| name | name of the parameter array as defined by this Material |
| type | the number of components for each individual parameter |
| v | array of values to set to the named parameter array |
| offset | the number of elements in `v` to skip |
| count | the number of elements in the parameter array to set
For example, to set a parameter array of 4 int4s:
```kotlin
int[] a = new int[4 * 4]; material.setDefaultParameter("param", MaterialInstance.IntElement.INT4, a, 0, 4);
``` |
#### See also
| |
|---|
| [Material](get-default-instance.md) |
[main]\
open fun [setDefaultParameter](set-default-parameter.md)(name: [String](https://developer.android.com/reference/kotlin/java/lang/String.html), type: [MaterialInstance.FloatElement](../-material-instance/-float-element/index.md), v: [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-array/index.html)<[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html)>, offset: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-int/index.html), count: [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-int/index.html))
Set a float parameter array by name.
#### Parameters
main
| | |
|---|---|
| name | name of the parameter array as defined by this Material |
| type | the number of components for each individual parameter |
| v | array of values to set to the named parameter array |
| offset | the number of elements in `v` to skip |
| count | the number of elements in the parameter array to set
For example, to set a parameter array of 4 float4s:
```kotlin
float[] a = new float[4 * 4]; material.setDefaultParameter("param", MaterialInstance.FloatElement.FLOAT4, a, 0, 4);
``` |
#### See also
| |
|---|
| [Material](get-default-instance.md) |
[main]\
open fun [setDefaultParameter](set-default-parameter.md)(name: [String](https://developer.android.com/reference/kotlin/java/lang/String.html), type: [Colors.RgbType](../-colors/-rgb-type/index.md), r: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html), g: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html), b: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html))
Sets the color of the given parameter on this material's default instance.
#### Parameters
main
| | |
|---|---|
| name | the name of the material color parameter |
| type | whether the color is specified in the linear or sRGB space |
| r | red component |
| g | green component |
| b | blue component |
#### See also
| |
|---|
| [Material](get-default-instance.md) |
[main]\
open fun [setDefaultParameter](set-default-parameter.md)(name: [String](https://developer.android.com/reference/kotlin/java/lang/String.html), type: [Colors.RgbaType](../-colors/-rgba-type/index.md), r: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html), g: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html), b: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html), a: [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin-stdlib/kotlin/-float/index.html))
Sets the color of the given parameter on this material's default instance.
#### Parameters
main
| | |
|---|---|
| name | the name of the material color parameter |
| type | whether the color is specified in the linear or sRGB space |
| r | red component |
| g | green component |
| b | blue component |
| a | alpha component |
#### See also
| |
|---|
| [Material](get-default-instance.md) |
[main]\
open fun [setDefaultParameter](set-default-parameter.md)(name: [String](https://developer.android.com/reference/kotlin/java/lang/String.html), texture: [Texture](../-texture/index.md), sampler: [TextureSampler](../-texture-sampler/index.md))
Sets a texture and sampler parameter on this material's default instance.
#### Parameters
main
| | |
|---|---|
| name | The name of the material texture parameter |
| texture | The texture to set as parameter |
| sampler | The sampler to be used with this texture |
#### See also
| |
|---|
| [Material](get-default-instance.md) |