phong.go 598 B

123456789101112131415161718192021222324
  1. // Copyright 2016 The G3N Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package material
  5. import (
  6. "github.com/g3n/engine/math32"
  7. )
  8. // Phong material is identical to the Standard material but
  9. // the calculation of the lighting model is done in the
  10. // fragment shader.
  11. type Phong struct {
  12. Standard // Embedded standard material
  13. }
  14. // NewPhong creates and returns a pointer to a new phong material
  15. func NewPhong(color *math32.Color) *Phong {
  16. pm := new(Phong)
  17. pm.Standard.Init("phong", color)
  18. return pm
  19. }