continue;
Sequence::Step &step = sequence.add_step(s.tag, *renderable);
- step.set_blend(s.blend);
step.set_depth_test(s.depth_test);
step.set_stencil_test(s.stencil_test);
step.set_lighting(s.lighting);
SequenceTemplate::Step::Loader::Loader(Step &p, Collection &c):
DataFile::CollectionObjectLoader<Step>(p, &c)
{
- add("blend", &Loader::blend);
- add("blend", &Loader::blend_factors);
add("depth_test", &Loader::depth_test);
add("depth_test", &Loader::depth_compare);
add("lighting", &Loader::lighting);
inline_base_name = n;
}
-void SequenceTemplate::Step::Loader::blend()
-{
- load_sub(obj.blend);
-}
-
-void SequenceTemplate::Step::Loader::blend_factors(BlendFactor src, BlendFactor dest)
-{
- obj.blend = Blend(src, dest);
-}
-
void SequenceTemplate::Step::Loader::depth_test()
{
load_sub(obj.depth_test);
#include <vector>
#include <msp/core/typeregistry.h>
#include <msp/datafile/objectloader.h>
-#include "blend.h"
#include "depthtest.h"
#include "postprocessor.h"
#include "resources.h"
void set_inline_base_name(const std::string &);
private:
- void blend();
- void blend_factors(BlendFactor, BlendFactor);
void depth_test();
void depth_compare(Predicate);
void lighting(const std::string &);
const Lighting *lighting = 0;
DepthTest depth_test;
StencilTest stencil_test;
- Blend blend;
std::string slot_name;
Renderable *default_renderable = 0;
};
face_cull = fc;
}
+void RenderMethod::set_blend(const Blend &b)
+{
+ blend = b;
+}
+
void RenderMethod::set_receive_shadows(bool rs)
{
receive_shadows = rs;
if(material)
renderer.add_shader_data(material->get_shader_data());
renderer.set_face_cull(face_cull);
+ renderer.set_blend(&blend);
}
void RenderMethod::set_debug_name(const string &name)
void RenderMethod::Loader::init_actions()
{
+ add("blend", &Loader::blend);
+ add("blend", &Loader::blend_factors);
add("face_cull", &RenderMethod::face_cull);
add("shader", &Loader::shader);
add("image_based_lighting", &RenderMethod::image_based_lighting);
obj.maybe_create_material_shader();
}
+void RenderMethod::Loader::blend()
+{
+ load_sub(obj.blend);
+}
+
+void RenderMethod::Loader::blend_factors(BlendFactor src, BlendFactor dest)
+{
+ obj.blend = Blend(src, dest);
+}
+
void RenderMethod::Loader::material_inline()
{
Material::GenericLoader ldr(get_collection());
#include <msp/core/refptr.h>
#include <msp/datafile/objectloader.h>
+#include "blend.h"
#include "cullface.h"
#include "material.h"
private:
virtual void finish();
+ void blend();
+ void blend_factors(BlendFactor, BlendFactor);
void material_inline();
void material(const std::string &);
void shader(const std::string &);
std::string material_slot;
std::vector<TextureSlot> textures;
CullMode face_cull = CULL_BACK;
+ Blend blend;
bool receive_shadows = false;
bool image_based_lighting = false;
Tag get_texture_tag(const std::string &) const;
void set_face_cull(CullMode);
CullMode get_face_cull() const { return face_cull; }
+ void set_blend(const Blend &);
+ const Blend &get_blend() const { return blend; }
void set_receive_shadows(bool);
bool get_receive_shadows() const { return receive_shadows; }
void set_image_based_lighting(bool);
renderer.set_depth_test(&s.get_depth_test());
renderer.set_stencil_test(&s.get_stencil_test());
- renderer.set_blend(&s.get_blend());
if(const Lighting *lighting = s.get_lighting())
renderer.add_shader_data(lighting->get_shader_data());
stencil_test = st;
}
-void Sequence::Step::set_blend(const Blend &b)
-{
- blend = b;
-}
-
} // namespace GL
} // namespace Msp
#define MSP_GL_SEQUENCE_H_
#include <vector>
-#include "blend.h"
+#include "color.h"
#include "depthtest.h"
#include "frameformat.h"
#include "renderable.h"
const Lighting *lighting;
DepthTest depth_test;
StencilTest stencil_test;
- Blend blend;
Renderable *renderable;
public:
void set_lighting(const Lighting *);
void set_depth_test(const DepthTest &);
void set_stencil_test(const StencilTest &);
- void set_blend(const Blend &);
const Lighting *get_lighting() const { return lighting; }
const DepthTest &get_depth_test() const { return depth_test; }
const StencilTest &get_stencil_test() const { return stencil_test; }
- const Blend &get_blend() const { return blend; }
Renderable *get_renderable() const { return renderable; }
};
GL::Sequence::Step &step = sequence->add_step(0, *renderable);
step.set_lighting(&lighting);
step.set_depth_test(GL::LEQUAL);
- step.set_blend(GL::Blend(GL::SRC_ALPHA, GL::ONE_MINUS_SRC_ALPHA));
}
view.set_content(sequence);