Skip to content

Commit

Permalink
lib: provide UBOs with better default values
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Aug 9, 2023
1 parent 978034e commit 7cf7391
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class GlobalUniformValues {
/**
* strength of the ambient light
*/
private float ambientStrength;
private float ambientStrength = 0.1f;
/**
* viewpoint for 3-D rendering
*/
Expand All @@ -65,7 +65,8 @@ class GlobalUniformValues {
/**
* direction to the directional light in world coordinates
*/
final private Vector3f lightDirectionWorldspace = new Vector3f();
final private Vector3f lightDirectionWorldspace
= new Vector3f(1f, 3f, 2f).normalize();
/**
* color of the lights
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class NonGlobalUniformValues {
/**
* material color to use with ambient/diffuse lighting
*/
final private Vector4f baseMaterialColor = new Vector4f();
final private Vector4f baseMaterialColor = new Vector4f(1f);
/**
* material color to use with specular reflections
*/
final private Vector4f specularMaterialColor = new Vector4f();
final private Vector4f specularMaterialColor = new Vector4f(1f);
// *************************************************************************
// new methods exposed

Expand Down

0 comments on commit 7cf7391

Please sign in to comment.