Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Odd and undesired behavior when adding a semi-transparent background layer above other layers #5832

Closed

Description

@danielamitay

Platform: iOS
Mapbox SDK version: ios-v3.3.2

Steps to trigger behavior

  1. Take any map style (e.g. Streets)
  2. Add a new background layer to be the topmost layer
  3. Make it's opacity anything between 0 and 1 (e.g. 0.5)

Simple example, only one layer added:
screen shot 2016-07-29 at 1 02 57 pm

Expected behavior

simulator screen shot jul 29 2016 2 44 58 pm

Actual behavior

(side note: Studio/gl-js has a different behavior than gl-native as well)

simulator screen shot jul 29 2016 1 07 41 pm

There are additional rendering issues at certain zoom levels:

From 11 to 11.5, and from 15.5 to 16.5:
11-11 5_250 15 5-16 5_250

Activity

  1. danielamitay commented on Jul 29, 2016

    @danielamitay
    Author

    Some more info:

    Here is what it looks like in Studio:

    screen shot 2016-07-29 at 4 17 05 pm

    I tried setting the color to have an alpha channel instead of the layer, and Studio rendered it correctly (however, rendering a semi-transparent background layer should still be supported):
    screen shot 2016-07-29 at 4 17 37 pm

    Unfortunately, doing a background layer with opacity 1 and fill color with an alpha channel looks like this on the device (and still has the visual glitches from the gifs above):

    simulator screen shot jul 29 2016 4 17 40 pm

  2. tmpsantos commented on Aug 1, 2016

    @tmpsantos
    Contributor

    Trying to repro here. On the editor it is exactly how you described. Same goes for android android-v4.1.1.

    Good news is it works just fine on native with the tip of the tree (472ab74).

    screenshot_20160801-182731_1024
    screenshot_from_2016-08-01_18-04-44

  3. tmpsantos commented on Aug 1, 2016

    @tmpsantos
    Contributor

    This issue was a problem with a shader.

    [ERROR] {mapbox-glfw}[OpenGL]: GL_DEBUG_SOURCE_API GL_DEBUG_TYPE_ERROR 54 GL_DEBUG_SEVERITY_HIGH - GL_INVALID_OPERATION in glUniform4("u_ratio"@1 has 1 components, not 4)
    terminate called after throwing an instance of 'mbgl::gl::Error'
      what():  glUniform4fv(location, 1, t.data()): Error GL_INVALID_OPERATION - ../../src/mbgl/shader/uniform.cpp:27
    

    Closing this ticket since the bug was fixed on the master branch.

  4. tmpsantos commented on Aug 1, 2016

    @tmpsantos
    Contributor

    Created a ticket on our test suite to add a test case like this, so I can also verify if this got fixed on mapbox-gl-js too. I would say probably yes since we share the same shaders.

  5. tmpsantos commented on Aug 1, 2016

    @tmpsantos
    Contributor

    For the record, it was fixed by a17b0bc.

  6. danielamitay commented on Aug 1, 2016

    @danielamitay
    Author

    Perfect, thank you! And good to know about the test suite repo too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions