(start xml.StartElement, pc *ProfileCOMMON)
| 567 | } |
| 568 | |
| 569 | func (d *Decoder) decPhong(start xml.StartElement, pc *ProfileCOMMON) error { |
| 570 | |
| 571 | ph := new(Phong) |
| 572 | pc.Technique.ShaderElement = ph |
| 573 | |
| 574 | for { |
| 575 | child, _, err := d.decNextChild(start) |
| 576 | if err != nil || child.Name.Local == "" { |
| 577 | return err |
| 578 | } |
| 579 | if child.Name.Local == "emission" { |
| 580 | err := d.decColorOrTexture(child, &ph.Emission) |
| 581 | if err != nil { |
| 582 | return err |
| 583 | } |
| 584 | continue |
| 585 | } |
| 586 | if child.Name.Local == "ambient" { |
| 587 | err := d.decColorOrTexture(child, &ph.Ambient) |
| 588 | if err != nil { |
| 589 | return err |
| 590 | } |
| 591 | continue |
| 592 | } |
| 593 | if child.Name.Local == "diffuse" { |
| 594 | err := d.decColorOrTexture(child, &ph.Diffuse) |
| 595 | if err != nil { |
| 596 | return err |
| 597 | } |
| 598 | continue |
| 599 | } |
| 600 | if child.Name.Local == "specular" { |
| 601 | err := d.decColorOrTexture(child, &ph.Specular) |
| 602 | if err != nil { |
| 603 | return err |
| 604 | } |
| 605 | continue |
| 606 | } |
| 607 | if child.Name.Local == "shininess" { |
| 608 | err := d.decFloatOrParam(child, &ph.Shininess) |
| 609 | if err != nil { |
| 610 | return err |
| 611 | } |
| 612 | continue |
| 613 | } |
| 614 | if child.Name.Local == "reflective" { |
| 615 | err := d.decFloatOrParam(child, &ph.Reflective) |
| 616 | if err != nil { |
| 617 | return err |
| 618 | } |
| 619 | continue |
| 620 | } |
| 621 | if child.Name.Local == "reflectivity" { |
| 622 | err := d.decFloatOrParam(child, &ph.Reflectivity) |
| 623 | if err != nil { |
| 624 | return err |
| 625 | } |
| 626 | continue |
no test coverage detected