missing PI division on vertex shader
This commit is contained in:
parent
cf17b081f1
commit
66987d6878
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
[vertex]
|
[vertex]
|
||||||
|
|
||||||
|
#define M_PI 3.14159265359
|
||||||
|
|
||||||
/*
|
/*
|
||||||
from VisualServer:
|
from VisualServer:
|
||||||
|
@ -166,7 +167,7 @@ out vec4 specular_light_interp;
|
||||||
void light_compute(vec3 N, vec3 L,vec3 V, vec3 light_color,float roughness,inout vec3 diffuse, inout vec3 specular) {
|
void light_compute(vec3 N, vec3 L,vec3 V, vec3 light_color,float roughness,inout vec3 diffuse, inout vec3 specular) {
|
||||||
|
|
||||||
float dotNL = max(dot(N,L), 0.0 );
|
float dotNL = max(dot(N,L), 0.0 );
|
||||||
diffuse += dotNL * light_color;
|
diffuse += dotNL * light_color / M_PI;
|
||||||
|
|
||||||
if (roughness > 0.0) {
|
if (roughness > 0.0) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue