+ main_tags.append("blended")
+
+ content = "content"
+ if use_ibl and scene.use_sky:
+ self.add_auxiliary_sequence(seq_res, "environment", "sky", ((0.0, 0.0, 0.0, 0.0), 1.0), main_tags, lighting_res)
+
+ st = Statement("effect", "environment")
+ st.sub.append(Statement("type", Token("environment_map")))
+ st.sub.append(Statement("size", 32))
+ st.sub.append(Statement("roughness_levels", 2))
+ st.sub.append(Statement("fixed_position", 0.0, 0.0, 0.0))
+ st.sub.append(Statement("content", content))
+ st.sub.append(Statement("environment", "environment_sequence"))
+
+ 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("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"