phong.go 595 B

1234567891011121314151617181920212223
  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 fragment shader.
  10. type Phong struct {
  11. Standard // Embedded standard material
  12. }
  13. // NewPhong creates and returns a pointer to a new phong material
  14. func NewPhong(color *math32.Color) *Phong {
  15. pm := new(Phong)
  16. pm.Standard.Init("phong", color)
  17. return pm
  18. }