提交 d1b37e0c 编写于 作者: J Jan Wrobel

Calculate envmap reflection vector for the phong material per fragment

resolves #5058
上级 3e9bebb3
......@@ -2,7 +2,7 @@
vec3 reflectVec;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );
......
......@@ -5,7 +5,7 @@
uniform float flipEnvMap;
uniform int combine;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
uniform bool useRefract;
uniform float refractionRatio;
......
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )
varying vec3 vReflect;
......
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )
#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )
vec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;
worldNormal = normalize( worldNormal );
......
......@@ -293,6 +293,8 @@ THREE.ShaderLib = {
fragmentShader: [
"#define PHONG",
"uniform vec3 diffuse;",
"uniform float opacity;",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册