Browse Source

Merge pull request #226 from DoobesURU/FixExpFog

Fix Exponential Fog
pull/232/head
Adam Johnson 4 years ago committed by GitHub
parent
commit
f4efe15e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      korman/exporter/manager.py
  2. 2
      korman/properties/prop_world.py
  3. 4
      korman/ui/ui_world.py

4
korman/exporter/manager.py

@ -329,8 +329,8 @@ class ExportManager:
stream.writeLine("Graphics.Renderer.Fog.SetDefColor {} {} {}".format(*fni.fog_color))
if fni.fog_method == "linear":
stream.writeLine("Graphics.Renderer.Fog.SetDefLinear {} {} {}".format(fni.fog_start, fni.fog_end, fni.fog_density))
elif fni.fog_method == "exp2":
stream.writeLine("Graphics.Renderer.Fog.SetDefExp2 {} {}".format(fni.fog_end, fni.fog_density))
elif fni.fog_method == "exp":
stream.writeLine("Graphics.Renderer.Fog.SetDefExp {} {}".format(fni.fog_end, fni.fog_density))
def _write_pages(self):
age_name = self._age_info.name

2
korman/properties/prop_world.py

@ -31,7 +31,7 @@ class PlasmaFni(bpy.types.PropertyGroup):
fog_method = EnumProperty(name="Fog Type",
items=[
("linear", "Linear", "Linear Fog"),
("exp2", "Exponential", "Exponential Fog"),
("exp", "Exponential", "Exponential Fog"),
("none", "None", "Use fog from the previous age")
])
fog_start = FloatProperty(name="Start",

4
korman/ui/ui_world.py

@ -262,6 +262,10 @@ class PlasmaEnvironmentPanel(AgeButtonsPanel, bpy.types.Panel):
layout = self.layout
fni = context.world.plasma_fni
# warn about reversed linear fog values
if fni.fog_method == "linear" and fni.fog_start >= fni.fog_end and (fni.fog_start + fni.fog_end) != 0:
layout.label(text="Fog Start Value should be less than the End Value", icon="ERROR")
# basic colors
split = layout.split()
col = split.column()

Loading…
Cancel
Save