zadvorsky / three.bas

THREE.JS Buffer Animation System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhongAnimationMaterial fragmentSpecular incorrect order?

clindsey opened this issue · comments

i'm having trouble controlling phong material's specular properties in the fragment shader using fragmentSpecular and material.specularShininess. I think the issue is that the fragmentSpecular block is injected after the lighting is calculated and only gets applied to the environment map

here is a demo of the current way it works, where the changes to material don't seem to be applied (expecting to see pink color) - https://codepen.io/clindsey/pen/GadgqZ

here's a demo where i've changed the ordering - https://codepen.io/clindsey/pen/oRdWKE

here's a PR for a potential fix - #35

Looks good, thanks for the PR!