Skip to content

Commit

Permalink
Change to Blenders lighting model
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero committed Mar 15, 2024
1 parent 81b3b85 commit a25db12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions io_ogre/ogre/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,13 @@ def dot_scene_node_export( ob, path, doc=None, rex=None,
a.setAttribute('falloff', '1.0')

a = doc.createElement('lightAttenuation'); l.appendChild( a )
# NOTE: No idea why a factor of 10 is required but otherwise it does not look correct
light_range = ob.data.cutoff_distance * 10
light_range = ob.data.cutoff_distance
if light_range == 0:
light_range = 0.001
a.setAttribute('range', light_range)
a.setAttribute('constant', '1.0')
a.setAttribute('linear', '%6f' % (4.5 / light_range))
a.setAttribute('quadratic', '%6f' % (75.0 / (light_range * light_range)))
a.setAttribute('linear', '%6f' % (0 / light_range))
a.setAttribute('quadratic', '%6f' % (1 / (light_range * light_range)))

# Node Animation
if config.get('NODE_ANIMATION') is True:
Expand Down
2 changes: 1 addition & 1 deletion io_ogre/ui/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def execute(self, context):
items=config.LOD_METHODS,
name='LOD Generation Method',
description='Method of generating LOD levels',
default=config.get('LOD_METHODS')) = {}
default=config.get('LOD_GENERATION')) = {}
EX_LOD_LEVELS : IntProperty(
name="LOD Levels",
description="Number of LOD levels",
Expand Down

0 comments on commit a25db12

Please sign in to comment.