Skip to content

Commit

Permalink
modified phong
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbenadler committed Dec 30, 2020
1 parent 8fc88c1 commit ff9e838
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/phong/fragment.lgl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ class light {
};
uniform light uLight;

struct positions {
cart3<world>.point worldPos;
class positions {
public cart3<world>.point worldPos;
public positions init(cart3<world>.point p) {
self(p);
}
};

void main() {
// vec4 gl_FragColor = vec4(uLight, .9);
hom<model>.transformation<camera> uModelView = uView * uModel;
color ambient = [0.1, 0., 0.];
positions p = positions(hom_reduce(uModel*homify(vPosition)));
positions p = new_positions(hom_reduce(uModel*homify(vPosition)));
auto camPos = hom_reduce(uView*uModel*homify(vPosition));
auto worldNorm = normalize(hom_reduce(uModel*homify(vNormal)));

Expand Down

0 comments on commit ff9e838

Please sign in to comment.