forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rendering poi, bookmarks and straight text with ortho view in 3d mode.
Conflicts: drape_frontend/frontend_renderer.cpp drape_frontend/render_group.cpp
- Loading branch information
Showing
14 changed files
with
316 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
attribute vec4 a_position; | ||
attribute vec2 a_normal; | ||
attribute vec2 a_colorTexCoord; | ||
attribute vec2 a_outlineColorTexCoord; | ||
attribute vec2 a_maskTexCoord; | ||
|
||
uniform mat4 modelView; | ||
uniform mat4 projection; | ||
uniform mat4 pivotTransform; | ||
uniform float u_isOutlinePass; | ||
|
||
#ifdef ENABLE_VTF | ||
uniform sampler2D u_colorTex; | ||
varying lowp vec4 v_color; | ||
#else | ||
varying vec2 v_colorTexCoord; | ||
#endif | ||
|
||
varying vec2 v_maskTexCoord; | ||
|
||
const float Zero = 0.0; | ||
const float One = 1.0; | ||
const float BaseDepthShift = -10.0; | ||
|
||
void main() | ||
{ | ||
float isOutline = step(0.5, u_isOutlinePass); | ||
float notOutline = One - isOutline; | ||
float depthShift = BaseDepthShift * isOutline; | ||
|
||
// Here we intentionally decrease precision of 'pos' calculation | ||
// to eliminate jittering effect in process of billboard reconstruction. | ||
lowp vec4 pivot = (a_position + vec4(Zero, Zero, depthShift, Zero)) * modelView; | ||
vec4 offset = vec4(a_normal, Zero, Zero); | ||
|
||
pivot = pivot * projection; | ||
offset = offset * projection; | ||
|
||
gl_Position = pivotTransform * vec4(pivot.xy, Zero, One); | ||
|
||
vec4 scale = pivotTransform * vec4(One, -One, Zero, One); | ||
gl_Position = gl_Position + vec4(offset.xy * gl_Position.w / scale.w * scale.x, Zero, Zero); | ||
|
||
vec2 colorTexCoord = a_colorTexCoord * notOutline + a_outlineColorTexCoord * isOutline; | ||
#ifdef ENABLE_VTF | ||
v_color = texture2D(u_colorTex, colorTexCoord); | ||
#else | ||
v_colorTexCoord = colorTexCoord; | ||
#endif | ||
v_maskTexCoord = a_maskTexCoord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
attribute vec4 a_position; | ||
attribute vec2 a_normal; | ||
attribute vec2 a_colorTexCoord; | ||
attribute vec2 a_maskTexCoord; | ||
|
||
uniform mat4 modelView; | ||
uniform mat4 projection; | ||
uniform mat4 pivotTransform; | ||
uniform float u_isOutlinePass; | ||
|
||
#ifdef ENABLE_VTF | ||
uniform sampler2D u_colorTex; | ||
varying lowp vec4 v_color; | ||
#else | ||
varying vec2 v_colorTexCoord; | ||
#endif | ||
|
||
varying vec2 v_maskTexCoord; | ||
|
||
const float Zero = 0.0; | ||
const float One = 1.0; | ||
|
||
void main() | ||
{ | ||
// Here we intentionally decrease precision of 'pivot' calculation | ||
// to eliminate jittering effect in process of billboard reconstruction. | ||
lowp vec4 pivot = a_position * modelView; | ||
vec4 offset = vec4(a_normal, Zero, Zero); | ||
|
||
pivot = pivot * projection; | ||
offset = offset * projection; | ||
|
||
gl_Position = pivotTransform * vec4(pivot.xy, Zero, One); | ||
|
||
vec4 scale = pivotTransform * vec4(One, -One, Zero, One); | ||
gl_Position = gl_Position + vec4(offset.xy * gl_Position.w / scale.w * scale.x, Zero, Zero); | ||
|
||
#ifdef ENABLE_VTF | ||
v_color = texture2D(u_colorTex, a_colorTexCoord); | ||
#else | ||
v_colorTexCoord = a_colorTexCoord; | ||
#endif | ||
v_maskTexCoord = a_maskTexCoord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
attribute vec2 a_pos; | ||
attribute vec2 a_tcoord; | ||
|
||
uniform mat4 rotate; | ||
uniform mat4 translate; | ||
uniform mat4 projection; | ||
uniform mat4 m_transform; | ||
|
||
varying vec2 v_tcoord; | ||
|
||
void main() | ||
{ | ||
|
||
v_tcoord = a_tcoord; | ||
gl_Position = projection * translate * rotate * vec4(a_pos, 0.0, 1.0); | ||
gl_Position = m_transform * vec4(a_pos, 0.0, 1.0); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
attribute vec3 a_position; | ||
attribute vec2 a_normal; | ||
attribute vec2 a_colorTexCoords; | ||
|
||
uniform mat4 modelView; | ||
uniform mat4 projection; | ||
uniform mat4 pivotTransform; | ||
|
||
varying vec2 v_colorTexCoords; | ||
|
||
void main(void) | ||
{ | ||
// Here we intentionally decrease precision of 'pivot' calculation | ||
// to eliminate jittering effect in process of billboard reconstruction. | ||
lowp vec4 pivot = vec4(a_position, 1) * modelView; | ||
vec4 offset = vec4(a_normal, 0, 0); | ||
|
||
pivot = pivot * projection; | ||
offset = offset * projection; | ||
|
||
gl_Position = pivotTransform * vec4(pivot.xy, 0, 1); | ||
|
||
vec4 scale = pivotTransform * vec4(1.0, -1.0, 0, 1.0); | ||
gl_Position = gl_Position + vec4(offset.xy * gl_Position.w / scale.w * scale.x, 0, 0); | ||
|
||
v_colorTexCoords = a_colorTexCoords; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
attribute vec3 a_position; | ||
attribute vec2 a_normal; | ||
attribute vec2 a_colorTexCoords; | ||
attribute float a_animate; | ||
|
||
uniform mat4 modelView; | ||
uniform mat4 projection; | ||
uniform mat4 pivotTransform; | ||
uniform float u_interpolationT; | ||
|
||
varying vec2 v_colorTexCoords; | ||
|
||
void main(void) | ||
{ | ||
vec2 normal = a_normal; | ||
if (a_animate > 0.0) | ||
normal = u_interpolationT * normal; | ||
|
||
vec4 pivot = vec4(a_position.xyz, 1) * modelView; | ||
vec4 offset = vec4(normal, 0, 0); | ||
|
||
pivot = pivot * projection; | ||
offset = offset * projection; | ||
|
||
gl_Position = pivotTransform * vec4(pivot.xy, 0, 1); | ||
|
||
vec4 scale = pivotTransform * vec4(1.0, -1.0, 0, 1.0); | ||
gl_Position = gl_Position + vec4(offset.xy * gl_Position.w / scale.w * scale.x, 0, 0); | ||
|
||
v_colorTexCoords = a_colorTexCoords; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.