X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_scene.py;h=ee9c8c2ff340135e62567061df30dfecb9e3a6eb;hb=03d6f389ff05d1ea573d4c0c5e1216cb756a6c20;hp=fa7ca5e538150f3e1df98f2054ddcf8880609385;hpb=7ae4af705535271ad84dbfe2b5a24bc9c546ae01;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_scene.py b/blender/io_mspgl/export_scene.py index fa7ca5e5..ee9c8c2f 100644 --- a/blender/io_mspgl/export_scene.py +++ b/blender/io_mspgl/export_scene.py @@ -101,29 +101,46 @@ class SceneExporter: lighting_name = scene.name+".lightn" if lighting_name not in resources: lighting_res = Resource(lighting_name, "lighting") + lighting_res.statements.append(Statement("ambient", *tuple(scene.ambient_light))) for l in lights: lighting_res.statements.append(lighting_res.create_reference_statement("light", resources[l.name+".light"])) resources[lighting_name] = lighting_res def export_sequence(self, scene, resources): - from .datafile import Resource, Statement + from .datafile import Resource, Statement, Token seq_res = Resource(scene.name+".seq", "sequence") + if scene.use_hdr: + seq_res.statements.append(Statement("hdr", True)) + content = scene if scene.background_set: content = resources[scene.name+".wrapper.scene"] - ss = Statement("pass", "", "content") - ss.sub.append(Statement("depth_test", "lequal")) + ss = Statement("step", "", "content") + ss.sub.append(Statement("depth_test", Token("LEQUAL"))) ss.sub.append(seq_res.create_reference_statement("lighting", resources[scene.name+".lightn"])) ss.sub.append(seq_res.create_reference_statement("scene", content)) seq_res.statements.append(ss) - # Add a colorcurve with linear response to convert into sRGB color space - ss = Statement("colorcurve") - ss.sub.append(Statement("brightness_response", 1.0)) - ss.sub.append(Statement("srgb")) - seq_res.statements.append(ss) + if scene.use_ao: + ss = Statement("ambient_occlusion") + ss.sub.append(Statement("occlusion_radius", scene.ao_distance)) + ss.sub.append(Statement("samples", scene.ao_samples)) + seq_res.statements.append(ss) + + if scene.use_hdr: + seq_res.statements.append(Statement("bloom")) + ss = Statement("colorcurve") + ss.sub.append(Statement("exposure_adjust", scene.exposure)) + ss.sub.append(Statement("srgb")) + seq_res.statements.append(ss) + else: + # Add a colorcurve with linear response to convert into sRGB color space + ss = Statement("colorcurve") + ss.sub.append(Statement("brightness_response", 1.0)) + ss.sub.append(Statement("srgb")) + seq_res.statements.append(ss) return seq_res