File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/main/java/engine/processing Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,27 @@ public void render(PointLight light) {
7373 light .getPosition ().getX (),
7474 light .getPosition ().getY (),
7575 light .getPosition ().getZ ());
76+
77+ float intensity = light .getIntensity ();
78+
79+ // Retrieve light color
80+ float red = light .getColor ().getRed (); // Gives a value from 0 to 1
81+ float green = light .getColor ().getGreen (); // Same for green
82+ float blue = light .getColor ().getBlue (); // Same for blue
83+
84+ // Apply intensity to each color component
85+ red *= intensity ;
86+ green *= intensity ;
87+ blue *= intensity ;
88+
89+ // Call pointLight() with adjusted color
90+ p .pointLight (
91+ red * 255 , // Scale back to 0-255 range for Processing's pointLight
92+ green * 255 , // Same for green
93+ blue * 255 , // Same for blue
94+ light .getPosition ().getX (),
95+ light .getPosition ().getY (),
96+ light .getPosition ().getZ ());
7697 }
7798
7899 public void render (DirectionalLight light ) {
You can’t perform that action at this time.
0 commit comments