MCPcopy
hub / github.com/g3n/engine / SetBaseColorMap

Method SetBaseColorMap

material/physical.go:89–101  ·  view source on GitHub ↗

SetBaseColorMap sets this material optional texture base color. Returns pointer to this updated material.

(tex *texture.Texture2D)

Source from the content-addressed store, hash-verified

87// SetBaseColorMap sets this material optional texture base color.
88// Returns pointer to this updated material.
89func (m *Physical) SetBaseColorMap(tex *texture.Texture2D) *Physical {
90
91 m.baseColorTex = tex
92 if m.baseColorTex != nil {
93 m.baseColorTex.SetUniformNames("uBaseColorSampler", "uBaseColorTexParams")
94 m.ShaderDefines.Set("HAS_BASECOLORMAP", "")
95 m.AddTexture(m.baseColorTex)
96 } else {
97 m.ShaderDefines.Unset("HAS_BASECOLORMAP")
98 m.RemoveTexture(m.baseColorTex)
99 }
100 return m
101}
102
103// SetMetallicRoughnessMap sets this material optional metallic-roughness texture.
104// Returns pointer to this updated material.

Callers 1

loadMaterialPBRMethod · 0.95

Calls 5

SetUniformNamesMethod · 0.80
AddTextureMethod · 0.80
UnsetMethod · 0.80
RemoveTextureMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected