+ seq_res.statements.append(st)
+ content = "environment"
+
+ if scene.use_sky:
+ st = Statement("effect", "sky")
+ st.sub.append(Statement("type", Token("sky")))
+ st.sub.append(seq_res.create_reference_statement("sun", resources[scene.sun_light.name+".light"]))
+ st.sub.append(Statement("content", content))
+
+ seq_res.statements.append(st)
+ content = "sky"
+
+ if use_shadow:
+ self.add_auxiliary_sequence(seq_res, "shadow", "content", (None, 1.0), ["shadow"], None)
+ self.add_auxiliary_sequence(seq_res, "thsm", "content", (None, 1.0), ["shadow_thsm"], None)
+
+ st = Statement("effect", "shadow_map")
+ st.sub.append(Statement("type", Token("shadow_map")))
+ st.sub.append(Statement("enable_for_method", "blended"))
+ st.sub.append(Statement("size", *self.compute_shadowmap_size(shadowed_lights)))
+ target, radius = self.compute_bounding_sphere(shadow_casters)
+ st.sub.append(Statement("target", *target))
+ st.sub.append(Statement("radius", radius))
+ st.sub.append(Statement("content", content))
+ st.sub.append(seq_res.create_reference_statement("lighting", lighting_res))
+ for l in shadowed_lights:
+ ss = seq_res.create_reference_statement("light", resources[l.name+".light"])
+ ss.sub.append(Statement("size", int(l.shadow_map_size)))
+ shadow_caster = "thsm_sequence" if l.type=='POINT' else "shadow_sequence"
+ ss.sub.append(Statement("shadow_caster", shadow_caster))
+ st.sub.append(ss)
+
+ seq_res.statements.append(st)
+ content = "shadow_map"
+
+ self.add_content_steps(seq_res, content, lighting_res, main_tags)
+
+ if scene.use_ao:
+ ss = Statement("postprocessor")
+ ss.sub.append(Statement("type", Token("ambient_occlusion")))
+ ss.sub.append(Statement("occlusion_radius", scene.ao_distance))
+ ss.sub.append(Statement("samples", scene.ao_samples))
+ seq_res.statements.append(ss)