diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-12-15 15:45:43 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2015-12-29 16:42:35 +0300 |
commit | 6c75501fec31b6dbd00a9caa9e841aac26564f5f (patch) | |
tree | 8f8ca933bd8f2455213cf1bf1c27b40368497daf /drape | |
parent | 29a96cdd6f614018025c957bd5f313ba8caa7607 (diff) |
Passing zScale as uniform.
Diffstat (limited to 'drape')
-rw-r--r-- | drape/shaders/area3d_vertex_shader.vsh | 5 | ||||
-rw-r--r-- | drape/shaders/position_accuracy3d_shader.vsh | 3 | ||||
-rwxr-xr-x | drape/shaders/text_billboard_vertex_shader.vsh | 2 | ||||
-rwxr-xr-x | drape/shaders/text_outlined_billboard_vertex_shader.vsh | 2 | ||||
-rw-r--r-- | drape/shaders/texturing_billboard_vertex_shader.vsh | 2 |
5 files changed, 6 insertions, 8 deletions
diff --git a/drape/shaders/area3d_vertex_shader.vsh b/drape/shaders/area3d_vertex_shader.vsh index 58352a9286..81a1fe54d0 100644 --- a/drape/shaders/area3d_vertex_shader.vsh +++ b/drape/shaders/area3d_vertex_shader.vsh @@ -5,6 +5,7 @@ attribute vec2 a_colorTexCoords; uniform mat4 modelView; uniform mat4 projection; uniform mat4 pivotTransform; +uniform float zScale; varying vec2 v_colorTexCoords; varying float v_intensity; @@ -14,10 +15,6 @@ const vec4 lightDir = vec4(1.0, 0.0, 3.0, 0.0); void main(void) { vec4 pos = vec4(a_position, 1.0) * modelView; - vec4 pos_dx = vec4(a_position.x + 1.0, a_position.y, 0.0, 1.0) * modelView; - vec2 dx = pos_dx.xy / pos_dx.w - pos.xy / pos.w; - - float zScale = projection[0][0] * length(dx); vec4 normal = vec4(a_position + a_normal, 1.0) * modelView; normal.xyw = (normal * projection).xyw; diff --git a/drape/shaders/position_accuracy3d_shader.vsh b/drape/shaders/position_accuracy3d_shader.vsh index a49aea75e8..f2be69f8a3 100644 --- a/drape/shaders/position_accuracy3d_shader.vsh +++ b/drape/shaders/position_accuracy3d_shader.vsh @@ -7,6 +7,7 @@ uniform float u_accuracy; uniform mat4 modelView; uniform mat4 projection; uniform mat4 pivotTransform; +uniform float zScale; varying vec2 v_colorTexCoords; @@ -15,7 +16,7 @@ void main(void) vec4 position = vec4(u_position.xy, 0.0, 1.0) * modelView; vec4 normal = vec4(normalize(a_normal) * u_accuracy, 0.0, 0.0); position = (position + normal) * projection; - float zScale = projection[0][0] * length(vec4(1.0, 0.0, 0.0, 0.0) * modelView); + float w = position.w; position.xyw = (pivotTransform * vec4(position.xy, u_position.z * zScale, w)).xyw; position.z *= position.w / w; diff --git a/drape/shaders/text_billboard_vertex_shader.vsh b/drape/shaders/text_billboard_vertex_shader.vsh index 19b03e8eb6..be61ec8353 100755 --- a/drape/shaders/text_billboard_vertex_shader.vsh +++ b/drape/shaders/text_billboard_vertex_shader.vsh @@ -7,6 +7,7 @@ uniform mat4 modelView; uniform mat4 projection; uniform mat4 pivotTransform; uniform float u_isOutlinePass; +uniform float zScale; #ifdef ENABLE_VTF uniform sampler2D u_colorTex; @@ -25,7 +26,6 @@ void main() vec4 offset = vec4(a_normal, 0.0, 0.0) * projection; float pivotZ = a_position.w; - float zScale = projection[0][0] * length(vec4(1.0, 0.0, 0.0, 0.0) * modelView); vec4 projectedPivot = pivot * projection; float logicZ = projectedPivot.z / projectedPivot.w; diff --git a/drape/shaders/text_outlined_billboard_vertex_shader.vsh b/drape/shaders/text_outlined_billboard_vertex_shader.vsh index 3631bf481e..706de84d4d 100755 --- a/drape/shaders/text_outlined_billboard_vertex_shader.vsh +++ b/drape/shaders/text_outlined_billboard_vertex_shader.vsh @@ -8,6 +8,7 @@ uniform mat4 modelView; uniform mat4 projection; uniform mat4 pivotTransform; uniform float u_isOutlinePass; +uniform float zScale; #ifdef ENABLE_VTF uniform sampler2D u_colorTex; @@ -32,7 +33,6 @@ void main() vec4 offset = vec4(a_normal, 0.0, 0.0) * projection; float pivotZ = a_position.w; - float zScale = projection[0][0] * length(vec4(1.0, 0.0, 0.0, 0.0) * modelView); vec4 projectedPivot = pivot * projection; float logicZ = projectedPivot.z / projectedPivot.w; diff --git a/drape/shaders/texturing_billboard_vertex_shader.vsh b/drape/shaders/texturing_billboard_vertex_shader.vsh index 4ddb8941a3..92e8571ec4 100644 --- a/drape/shaders/texturing_billboard_vertex_shader.vsh +++ b/drape/shaders/texturing_billboard_vertex_shader.vsh @@ -5,6 +5,7 @@ attribute vec2 a_colorTexCoords; uniform mat4 modelView; uniform mat4 projection; uniform mat4 pivotTransform; +uniform float zScale; varying vec2 v_colorTexCoords; @@ -16,7 +17,6 @@ void main(void) vec4 offset = vec4(a_normal, 0.0, 0.0) * projection; float pivotZ = a_position.w; - float zScale = projection[0][0] * length(vec4(1.0, 0.0, 0.0, 0.0) * modelView); vec4 projectedPivot = pivot * projection; float logicZ = projectedPivot.z / projectedPivot.w; |