SetNormalMap sets this material optional normal texture. Returns pointer to this updated material. TODO add SetNormalMap (and SetSpecularMap) to StandardMaterial.
(tex *texture.Texture2D)
| 120 | // Returns pointer to this updated material. |
| 121 | // TODO add SetNormalMap (and SetSpecularMap) to StandardMaterial. |
| 122 | func (m *Physical) SetNormalMap(tex *texture.Texture2D) *Physical { |
| 123 | |
| 124 | m.normalTex = tex |
| 125 | if m.normalTex != nil { |
| 126 | m.normalTex.SetUniformNames("uNormalSampler", "uNormalTexParams") |
| 127 | m.ShaderDefines.Set("HAS_NORMALMAP", "") |
| 128 | m.AddTexture(m.normalTex) |
| 129 | } else { |
| 130 | m.ShaderDefines.Unset("HAS_NORMALMAP") |
| 131 | m.RemoveTexture(m.normalTex) |
| 132 | } |
| 133 | return m |
| 134 | } |
| 135 | |
| 136 | // SetOcclusionMap sets this material optional occlusion texture. |
| 137 | // Returns pointer to this updated material. |
no test coverage detected