opengl.shaders.lighting: Add 'TODO' for attenuation bug in lighting shader.
This commit is contained in:
@@ -43,7 +43,7 @@ apply_Light (light Light,
|
|||||||
// Point light.
|
// Point light.
|
||||||
//
|
//
|
||||||
vec3 Surface_to_Light_vector = Light.Site.xyz - surface_Site;
|
vec3 Surface_to_Light_vector = Light.Site.xyz - surface_Site;
|
||||||
float Distance_to_Light = length (Surface_to_Light_vector);
|
float Distance_to_Light = length (Surface_to_Light_vector); // TODO: This is buggy causes wrong attenuation.
|
||||||
|
|
||||||
Surface_to_Light = normalize (Surface_to_Light_vector);
|
Surface_to_Light = normalize (Surface_to_Light_vector);
|
||||||
Attenuation = 1.0
|
Attenuation = 1.0
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ main()
|
|||||||
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
||||||
vec3 Normal = normalize ( frag_Normal
|
vec3 Normal = normalize ( frag_Normal
|
||||||
* inverse_model_Rotation);
|
* inverse_model_Rotation);
|
||||||
|
|
||||||
// Combine color from all the lights.
|
// Combine color from all the lights.
|
||||||
//
|
//
|
||||||
vec3 linear_Color = vec3 (0);
|
vec3 linear_Color = vec3 (0);
|
||||||
|
|||||||
@@ -13,11 +13,10 @@ apply_Texturing (vec2 Coords)
|
|||||||
* texture (Textures [i], Coords).a
|
* texture (Textures [i], Coords).a
|
||||||
* (1.0 - Fade [i]);
|
* (1.0 - Fade [i]);
|
||||||
|
|
||||||
// Color.a += texture (Textures [i], Coords).a * (1.0 - Fade[1]);
|
// Color.a += texture (Textures [i], Coords).a * (1.0 - Fade [1]);
|
||||||
|
|
||||||
Color.a = max (Color.a,
|
Color.a = max (Color.a,
|
||||||
texture (Textures [i],Coords).a * (1.0 - Fade[i]));
|
texture (Textures [i],Coords).a * (1.0 - Fade [i]));
|
||||||
|
|
||||||
|
|
||||||
// Color.a = max (Color.a,
|
// Color.a = max (Color.a,
|
||||||
// texture (Textures [i],Coords).a);
|
// texture (Textures [i],Coords).a);
|
||||||
|
|||||||
Reference in New Issue
Block a user