X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Frendermethod.cpp;h=ddbe4f1e457e83760dc699bce85ad52dd64ac29e;hp=5c838ef945624629483ea2fff992b1564285137a;hb=HEAD;hpb=9ec0e018234391efa66cc0f4080bfe470b910288 diff --git a/source/materials/rendermethod.cpp b/source/materials/rendermethod.cpp index 5c838ef9..78b937d0 100644 --- a/source/materials/rendermethod.cpp +++ b/source/materials/rendermethod.cpp @@ -34,6 +34,8 @@ void RenderMethod::maybe_create_material_shader() extra_spec["use_shadow_map"] = true; if(image_based_lighting) extra_spec["use_image_based_lighting"] = true; + if(instancing) + extra_spec["use_instancing"] = true; shprog = material->create_compatible_shader(extra_spec); @@ -81,7 +83,7 @@ void RenderMethod::set_texture(Tag tag, const Texture *tex, const Sampler *samp) auto i = find_member(textures, tag, &TextureSlot::tag); if(i==textures.end()) { - textures.push_back(TextureSlot(tag)); + textures.emplace_back(tag); i = textures.end()-1; } i->texture = tex; @@ -152,8 +154,9 @@ 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("shader", &Loader::shader); add("image_based_lighting", &RenderMethod::image_based_lighting); + add("instancing", &RenderMethod::instancing); add("material", &Loader::material_inline); add("material", &Loader::material); add("material_slot", &RenderMethod::material_slot); @@ -216,7 +219,7 @@ void RenderMethod::Loader::texture(const string &n) auto i = find_member(obj.textures, Tag(n), &TextureSlot::tag); if(i==obj.textures.end()) { - obj.textures.push_back(TextureSlot(n)); + obj.textures.emplace_back(n); i = obj.textures.end()-1; } TextureSlot::Loader ldr(*i, n, coll);