forked from organicmaps/organicmaps
Renaming sprite to billboard
Conflicts: drape_frontend/render_group.cpp
This commit is contained in:
parent
9b5abcbf1c
commit
3753914d26
11 changed files with 24 additions and 23 deletions
|
@ -16,7 +16,7 @@ ROUTE_PROGRAM route_vertex_shader.vsh route_fragment_shader.fsh
|
|||
ROUTE_ARROW_PROGRAM route_vertex_shader.vsh route_arrow_fragment_shader.fsh
|
||||
DEBUG_RECT_PROGRAM debug_rect_vertex_shader.vsh debug_rect_fragment_shader.fsh
|
||||
TEXTURING_3D_PROGRAM texturing3d_vertex_shader.vsh texturing3d_fragment_shader.fsh
|
||||
TEXTURING_SPRITE_PROGRAM texturing_sprite_vertex_shader.vsh texturing_fragment_shader.fsh
|
||||
TEXT_OUTLINED_SPRITE_PROGRAM text_outlined_sprite_vertex_shader.vsh text_fragment_shader.fsh
|
||||
TEXT_SPRITE_PROGRAM text_sprite_vertex_shader.vsh text_fragment_shader.fsh
|
||||
BOOKMARK_SPRITE_PROGRAM user_mark_sprite.vsh texturing_fragment_shader.fsh
|
||||
TEXTURING_BILLBOARD_PROGRAM texturing_billboard_vertex_shader.vsh texturing_fragment_shader.fsh
|
||||
TEXT_OUTLINED_BILLBOARD_PROGRAM text_outlined_billboard_vertex_shader.vsh text_fragment_shader.fsh
|
||||
TEXT_BILLBOARD_PROGRAM text_billboard_vertex_shader.vsh text_fragment_shader.fsh
|
||||
BOOKMARK_BILLBOARD_PROGRAM user_mark_billboard.vsh texturing_fragment_shader.fsh
|
||||
|
|
|
@ -46,7 +46,7 @@ FrontendRenderer::FrontendRenderer(Params const & params)
|
|||
, m_routeRenderer(new RouteRenderer())
|
||||
, m_overlayTree(new dp::OverlayTree())
|
||||
, m_useFramebuffer(false)
|
||||
, m_isSpriteRenderPass(false)
|
||||
, m_isBillboardRenderPass(false)
|
||||
, m_3dModeChanged(true)
|
||||
, m_framebuffer(new Framebuffer())
|
||||
, m_renderer3d(new Renderer3d())
|
||||
|
@ -795,7 +795,7 @@ void FrontendRenderer::RenderScene(ScreenBase const & modelView)
|
|||
m_framebuffer->Disable();
|
||||
m_renderer3d->Render(modelView, m_framebuffer->GetTextureId(), make_ref(m_gpuProgramManager));
|
||||
// Test code to check ortho overlays in 3d mode
|
||||
m_isSpriteRenderPass = true;
|
||||
m_isBillboardRenderPass = true;
|
||||
GLFunctions::glDisable(gl_const::GLDepthTest);
|
||||
for (currentRenderGroup = 0; currentRenderGroup < m_renderGroups.size(); ++currentRenderGroup)
|
||||
{
|
||||
|
@ -810,7 +810,7 @@ void FrontendRenderer::RenderScene(ScreenBase const & modelView)
|
|||
if (m_userMarkVisibility.find(group->GetTileKey()) != m_userMarkVisibility.end())
|
||||
RenderSingleGroup(modelView, make_ref(group));
|
||||
}
|
||||
m_isSpriteRenderPass = false;
|
||||
m_isBillboardRenderPass = false;
|
||||
// End of test code
|
||||
}
|
||||
|
||||
|
@ -821,20 +821,20 @@ void FrontendRenderer::RenderScene(ScreenBase const & modelView)
|
|||
#endif
|
||||
}
|
||||
|
||||
bool FrontendRenderer::IsSpriteProgram(int programIndex) const
|
||||
bool FrontendRenderer::IsBillboardProgram(int programIndex) const
|
||||
{
|
||||
return programIndex == gpu::TEXTURING_SPRITE_PROGRAM
|
||||
|| programIndex == gpu::TEXT_SPRITE_PROGRAM
|
||||
|| programIndex == gpu::TEXT_OUTLINED_SPRITE_PROGRAM
|
||||
|| programIndex == gpu::BOOKMARK_SPRITE_PROGRAM;
|
||||
return programIndex == gpu::TEXTURING_BILLBOARD_PROGRAM
|
||||
|| programIndex == gpu::TEXT_BILLBOARD_PROGRAM
|
||||
|| programIndex == gpu::TEXT_OUTLINED_BILLBOARD_PROGRAM
|
||||
|| programIndex == gpu::BOOKMARK_BILLBOARD_PROGRAM;
|
||||
}
|
||||
|
||||
void FrontendRenderer::RenderSingleGroup(ScreenBase const & modelView, ref_ptr<BaseRenderGroup> group)
|
||||
{
|
||||
dp::GLState const & state = group->GetState();
|
||||
bool isSpriteProgram = IsSpriteProgram(state.GetProgramIndex());
|
||||
bool isBillboardProgram = IsBillboardProgram(state.GetProgramIndex());
|
||||
|
||||
if (m_useFramebuffer && (m_isSpriteRenderPass != isSpriteProgram))
|
||||
if (m_useFramebuffer && (m_isBillboardRenderPass != isBillboardProgram))
|
||||
return;
|
||||
|
||||
group->UpdateAnimation();
|
||||
|
|
|
@ -210,7 +210,7 @@ private:
|
|||
FeatureID GetVisiblePOI(m2::PointD const & pixelPoint) const;
|
||||
FeatureID GetVisiblePOI(m2::RectD const & pixelRect) const;
|
||||
|
||||
bool IsSpriteProgram(int programIndex) const;
|
||||
bool IsBillboardProgram(int programIndex) const;
|
||||
|
||||
private:
|
||||
drape_ptr<dp::GpuProgramManager> m_gpuProgramManager;
|
||||
|
@ -230,7 +230,7 @@ private:
|
|||
dp::UniformValuesStorage m_generalUniforms;
|
||||
|
||||
bool m_useFramebuffer;
|
||||
bool m_isSpriteRenderPass;
|
||||
bool m_isBillboardRenderPass;
|
||||
bool m_3dModeChanged;
|
||||
drape_ptr<Framebuffer> m_framebuffer;
|
||||
drape_ptr<Renderer3d> m_renderer3d;
|
||||
|
|
|
@ -43,7 +43,7 @@ void PoiSymbolShape::Draw(ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManag
|
|||
glsl::vec2(texRect.maxX(), texRect.minY())},
|
||||
};
|
||||
|
||||
dp::GLState state(gpu::TEXTURING_SPRITE_PROGRAM, dp::GLState::OverlayLayer);
|
||||
dp::GLState state(gpu::TEXTURING_BILLBOARD_PROGRAM, dp::GLState::OverlayLayer);
|
||||
state.SetColorTexture(region.GetTexture());
|
||||
state.SetTextureFilter(gl_const::GLNearest);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ void RenderGroup::Render(ScreenBase const & screen)
|
|||
auto const & params = df::VisualParams::Instance().GetGlyphVisualParams();
|
||||
int programIndex = m_state.GetProgramIndex();
|
||||
if (programIndex == gpu::TEXT_OUTLINED_PROGRAM ||
|
||||
programIndex == gpu::TEXT_OUTLINED_SPRITE_PROGRAM)
|
||||
programIndex == gpu::TEXT_OUTLINED_BILLBOARD_PROGRAM)
|
||||
{
|
||||
m_uniforms.SetFloatValue("u_contrastGamma", params.m_outlineContrast, params.m_outlineGamma);
|
||||
m_uniforms.SetFloatValue("u_isOutlinePass", 1.0f);
|
||||
|
@ -92,7 +92,7 @@ void RenderGroup::Render(ScreenBase const & screen)
|
|||
renderBucket->Render(screen);
|
||||
}
|
||||
else if (programIndex == gpu::TEXT_PROGRAM ||
|
||||
programIndex == gpu::TEXT_SPRITE_PROGRAM)
|
||||
programIndex == gpu::TEXT_BILLBOARD_PROGRAM)
|
||||
{
|
||||
m_uniforms.SetFloatValue("u_contrastGamma", params.m_contrast, params.m_gamma);
|
||||
dp::ApplyUniforms(m_uniforms, m_shader);
|
||||
|
|
|
@ -163,7 +163,7 @@ void TextShape::DrawSubStringPlain(StraightTextLayout const & layout, dp::FontDe
|
|||
layout.Cache(glsl::vec3(glsl::ToVec2(m_basePoint), m_params.m_depth),
|
||||
baseOffset, color, staticBuffer, dynamicBuffer);
|
||||
|
||||
dp::GLState state(gpu::TEXT_SPRITE_PROGRAM, dp::GLState::OverlayLayer);
|
||||
dp::GLState state(gpu::TEXT_BILLBOARD_PROGRAM, dp::GLState::OverlayLayer);
|
||||
ASSERT(color.GetTexture() == outline.GetTexture(), ());
|
||||
state.SetColorTexture(color.GetTexture());
|
||||
state.SetMaskTexture(layout.GetMaskTexture());
|
||||
|
@ -206,7 +206,7 @@ void TextShape::DrawSubStringOutlined(StraightTextLayout const & layout, dp::Fon
|
|||
layout.Cache(glsl::vec3(glsl::ToVec2(m_basePoint), m_params.m_depth),
|
||||
baseOffset, color, outline, staticBuffer, dynamicBuffer);
|
||||
|
||||
dp::GLState state(gpu::TEXT_OUTLINED_SPRITE_PROGRAM, dp::GLState::OverlayLayer);
|
||||
dp::GLState state(gpu::TEXT_OUTLINED_BILLBOARD_PROGRAM, dp::GLState::OverlayLayer);
|
||||
ASSERT(color.GetTexture() == outline.GetTexture(), ());
|
||||
state.SetColorTexture(color.GetTexture());
|
||||
state.SetMaskTexture(layout.GetMaskTexture());
|
||||
|
@ -224,7 +224,8 @@ void TextShape::DrawSubStringOutlined(StraightTextLayout const & layout, dp::Fon
|
|||
GetOverlayPriority(),
|
||||
textures,
|
||||
isOptional,
|
||||
move(dynamicBuffer));
|
||||
move(dynamicBuffer),
|
||||
true);
|
||||
handle->SetOverlayRank(m_hasPOI ? (isPrimary ? dp::OverlayRank1 : dp::OverlayRank2) : dp::OverlayRank0);
|
||||
handle->SetExtendingSize(m_params.m_extendingSize);
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ void CacheUserPoints(UserMarksProvider const * provider,
|
|||
buffer.emplace_back(pos, right + up + offset, glsl::ToVec2(texRect.RightBottom()), runAnim);
|
||||
}
|
||||
|
||||
dp::GLState state(gpu::BOOKMARK_SPRITE_PROGRAM, dp::GLState::UserMarkLayer);
|
||||
dp::GLState state(gpu::BOOKMARK_BILLBOARD_PROGRAM, dp::GLState::UserMarkLayer);
|
||||
state.SetColorTexture(region.GetTexture());
|
||||
|
||||
dp::AttributeProvider attribProvider(1, buffer.size());
|
||||
|
|
Loading…
Add table
Reference in a new issue