From fe44eacf78736f99bdfd3bc3ac86abd17e8ad514 Mon Sep 17 00:00:00 2001 From: Alexander Romanov Date: Mon, 4 Jul 2016 11:01:32 +0300 Subject: Environment lighting for the GLSL mode Environment lighting (aka ambient) is a key component of any renderer. It's implemented like the Environment lighting of BI render for Approximate Gather mode. It support "Sky Color" and "White" Environment lighting modes. It would be great if the user could see actual lighting conditions right in the Blender viewport instead of waiting for the renderer to complete the final image, exporting for external renderer or for a game engine. Before: {F113921} After: {F113922} Example file: {F319013} Original author: valentin_b4w Alexander (Blend4Web Team) Reviewers: valentin_b4w, campbellbarton, merwin, brecht Reviewed By: brecht Subscribers: panzergame, youle, duarteframos, AlexKowel, yurikovelenov, dingto, Evgeny_Rodygin Projects: #rendering, #opengl_gfx Differential Revision: https://developer.blender.org/D810 --- release/scripts/startup/bl_ui/properties_game.py | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'release/scripts/startup/bl_ui/properties_game.py') diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 8baad4ea0f2..300be708049 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -404,6 +404,7 @@ class RENDER_PT_game_shading(RenderButtonsPanel, Panel): col.prop(gs, "use_glsl_lights", text="Lights") col.prop(gs, "use_glsl_shaders", text="Shaders") col.prop(gs, "use_glsl_shadows", text="Shadows") + col.prop(gs, "use_glsl_environment_lighting", text="Environment Lighting") col = split.column() col.prop(gs, "use_glsl_ramps", text="Ramps") @@ -599,9 +600,35 @@ class WORLD_PT_game_world(WorldButtonsPanel, Panel): row = layout.row() row.column().prop(world, "horizon_color") + row.column().prop(world, "zenith_color") row.column().prop(world, "ambient_color") +class WORLD_PT_game_environment_lighting(WorldButtonsPanel, Panel): + bl_label = "Environment Lighting" + COMPAT_ENGINES = {'BLENDER_GAME'} + + @classmethod + def poll(cls, context): + scene = context.scene + return (scene.world and scene.render.engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + light = context.world.light_settings + self.layout.prop(light, "use_environment_light", text="") + + def draw(self, context): + layout = self.layout + + light = context.world.light_settings + + layout.active = light.use_environment_light + + split = layout.split() + split.prop(light, "environment_energy", text="Energy") + split.prop(light, "environment_color", text="") + + class WORLD_PT_game_mist(WorldButtonsPanel, Panel): bl_label = "Mist" COMPAT_ENGINES = {'BLENDER_GAME'} -- cgit v1.2.3