Skip to content

Commit

Permalink
Matching Candela between light types
Browse files Browse the repository at this point in the history
Candela intensity should output the same brightness for all light types, so it's better to remove the legacy conversion for area lights using candela. However, this change breaks the conversion  from lumen to candela.
  • Loading branch information
michelchafouin committed Feb 17, 2020
1 parent 982a076 commit 1cead0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions export/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,11 +719,11 @@ def _convert_area_light(obj, scene, is_viewport_render, exporter, depsgraph, lux
if light.luxcore.per_square_meter:
mat_definitions["emission.power"] = 0.0
mat_definitions["emission.efficency"] = 0.0
mat_definitions["emission.gain"] = [light.luxcore.candela * 2.0908]*3
mat_definitions["emission.gain"] = [light.luxcore.candela]*3
mat_definitions["emission.gain.normalizebycolor"] = light.luxcore.normalizebycolor
else:
# Multiply with pi to match brightness with other light types
mat_definitions["emission.power"] = light.luxcore.candela * 2.0908 * math.pi
mat_definitions["emission.power"] = light.luxcore.candela * math.pi
mat_definitions["emission.efficency"] = 1.0
mat_definitions["emission.normalizebycolor"] = light.luxcore.normalizebycolor
if light.luxcore.candela == 0:
Expand Down
4 changes: 2 additions & 2 deletions nodes/materials/emission.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ def export_emission(self, exporter, depsgraph, props, definitions):
if self.per_square_meter:
definitions["emission.power"] = 0.0
definitions["emission.efficency"] = 0
definitions["emission.gain"] = [self.candela * 2.0908] * 3
definitions["emission.gain"] = [self.candela] * 3
definitions["emission.gain.normalizebycolor"] = self.normalizebycolor
else:
definitions["emission.power"] = self.candela * math.pi * 2.0908
definitions["emission.power"] = self.candela * math.pi
definitions["emission.efficency"] = 1.0
definitions["emission.normalizebycolor"] = self.normalizebycolor
if self.candela == 0:
Expand Down

0 comments on commit 1cead0e

Please sign in to comment.