#pragma once #include #include #include #include #include #include #include namespace mbgl { namespace uniforms { MBGL_DEFINE_UNIFORM_SCALAR(Color, shadow); MBGL_DEFINE_UNIFORM_SCALAR(Color, highlight); MBGL_DEFINE_UNIFORM_SCALAR(Color, accent); MBGL_DEFINE_UNIFORM_VECTOR(float, 2, light); MBGL_DEFINE_UNIFORM_VECTOR(float, 2, latrange); } // namespace uniforms class HillshadeProgram : public Program< HillshadeProgram, gfx::PrimitiveType::Triangle, TypeList< attributes::pos, attributes::texture_pos>, TypeList< uniforms::matrix, uniforms::highlight, uniforms::shadow, uniforms::accent, uniforms::light, uniforms::latrange>, TypeList< textures::image>, style::HillshadePaintProperties>{ public: using Program::Program; static LayoutVertex layoutVertex(Point p, Point t) { return LayoutVertex { {{ p.x, p.y }}, {{ t.x, t.y }} }; } }; using HillshadeLayoutVertex = HillshadeProgram::LayoutVertex; using HillshadeAttributes = HillshadeProgram::AttributeList; class HillshadeLayerPrograms final : public LayerTypePrograms { public: HillshadeLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : hillshade(context, programParameters), hillshadePrepare(context, programParameters) {} HillshadeProgram hillshade; HillshadePrepareProgram hillshadePrepare; }; } // namespace mbgl