Code Monkey home page Code Monkey logo

Comments (17)

jbms avatar jbms commented on May 30, 2024

On iOS, Apple only permits the Safari web browser so there is no way around any limitations it may have. Other browsers like "Chrome" and "Firefox" available in the app store are actually just reskinned versions of Safari.

Safari 15 and later have support for WebGL 2, which is required by Neuroglancer, but it is possible there are still limitations. If you can provide a screenshot or any error messages, that may help in determining what the problem is.

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

@jbms thanks for your response, I am on the FlyWire Codex team with Arie. Apologies in advance for the awkwardly sized screenshots

For example, take this neuroglancer view

Which on macOS Safari, and other desktop browsers, renders as so:
Screenshot 2023-07-05 at 2 27 29 PM

Note both layers render, the whole-brain mesh and the neuron.

Loading the same view on iOS (after waiting some time for the particularly large neuron to load), we see this:
IMG_52DE13F6703E-1

No whole-brain mesh. This view sometimes simply crashes the entire page on iOS as well:
IMG_5578

These were captured on a device running the latest iOS 17 Beta, but we see the same results on other iOS versions

Upon connecting the iOS device up to the debugger, and loading the page, I am seeing some errors:

Screenshot 2023-07-05 at 2 32 40 PM Screenshot 2023-07-05 at 2 30 24 PM

We're continuing to debug and explore this issue, and will provide anything else we find out. Thank you for your help

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

Here is our construction of the view URL, in case it is helpful

def url_for_cells(segment_ids, data_version):
    if data_version not in DATA_SNAPSHOT_VERSION_DESCRIPTIONS:
        log_error(
            f"Invalid version '{data_version}' passed to 'url_for_cells'. Falling back to default."
        )
        data_version = DEFAULT_DATA_SNAPSHOT_VERSION

    config = {
        "dimensions": {"x": [1.6e-8, "m"], "y": [1.6e-8, "m"], "z": [4e-8, "m"]},
        "projectionScale": 30000,
        "layers": [
            {
                "type": "image",
                "source": "precomputed://https://bossdb-open-data.s3.amazonaws.com/flywire/fafbv14",
                "tab": "source",
                "name": "EM",
            },
            {
                "source": "precomputed://gs://flywire_neuropil_meshes/whole_neuropil/brain_mesh_v3",
                "type": "segmentation",
                "objectAlpha": 0.05,
                "hideSegmentZero": False,
                "segments": ["1"],
                "segmentColors": {"1": "#b5b5b5"},
                "skeletonRendering": {"mode2d": "lines_and_points", "mode3d": "lines"},
                "name": "brain_mesh_v3",
            },
            {
                "type": "segmentation",
                "source": f"precomputed://gs://flywire_v141_m{data_version}",
                "tab": "segments",
                "segments": [
                    str(sid) for sid in segment_ids
                ],  # BEWARE: JSON can't handle big ints
                "name": f"flywire_v141_m{data_version}",
            },
        ],
        "showSlices": False,
        "perspectiveViewBackgroundColor": "#ffffff",
        "showDefaultAnnotations": False,
        "selectedLayer": {
            "visible": len(segment_ids) > 1,
            "layer": f"flywire_v141_m{data_version}",
        },
        "layout": "3d",
    }

    return f"{NGL_FLAT_BASE_URL}/#!{urllib.parse.quote(json.dumps(config))}"

from neuroglancer.

chrisj avatar chrisj commented on May 30, 2024

I haven't had much time to debug it but it is reproducible using the Xcode IOS simulator and attaching the mac safari dev tools to the simulator.

from neuroglancer.

copypasteearth avatar copypasteearth commented on May 30, 2024

Any fix for this? The same is happening to me. But the problem is a 308 http error and the difference in some GET request succeeding and failing is safari is requesting

/data/somefile
For ones that succeed

And
/data//somefile
For ones throwing 308 http error.

Is there some configuration for the webserver I'm using to serve the files?
I'm using flask airflow

from neuroglancer.

jbms avatar jbms commented on May 30, 2024

As far as the initial issue, I suspect it may be that the mesh is too large and it's exceeding some memory limit on iOS. Reducing the size of the mesh (e.g. with simplification) may help.

Not sure about the extra slash issue, can you provide more details about that?

from neuroglancer.

copypasteearth avatar copypasteearth commented on May 30, 2024

When neuroglancer is requesting info files it is fine. But when it requests some of the data that is in the info files sometimes it requests

/data/file

and sometimes it requests

/data//file

The double slash throws a 308 error on safari which results in the cannot fetch chunk error above

When I run my web server locally it works but when I deploy to ec2 it fails

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

Hey @jbms, thanks again for your help with this.

As far as the initial issue, I suspect it may be that the mesh is too large and it's exceeding some memory limit on iOS. Reducing the size of the mesh (e.g. with simplification) may help.

We don't believe it's a size/memory issue. As an example, take this mainline neuroglancer view showing a very small mesh. On all other platforms/browsers it renders correctly, but on iOS does not render at all.

from neuroglancer.

jbms avatar jbms commented on May 30, 2024

If you set the opacity of the meshes to 1 (in rendering tab) does it then render on iOS?

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

Ahh, yes it does apparently, thank you! I think we will be able to use this as a workaround for rendering neuropil meshes, but not for our whole-brain mesh

from neuroglancer.

copypasteearth avatar copypasteearth commented on May 30, 2024

@jbms @rmorey has this been resolved, i am trying to use opacity and silhouete in iOS safari and it just makes them dissapear?

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

@jbms @rmorey has this been resolved, i am trying to use opacity and silhouete in iOS safari and it just makes them dissapear?

I believe it's not, there's some underlying issue with the way WebKit handles transparency in WebGL

from neuroglancer.

jbms avatar jbms commented on May 30, 2024

There are a few different issues mentioned here. Can you clarify which ones you are referring to?

Let's keep this issue just for the meshes only appearing with opacity 1, and open a separate issue for the slash issue if that still exists.

One thing that isn't clear to me: the out of bounds memory access error --- does that still occur? How is that related to the meshes appearing or not and how does it relate to the opacity?

from neuroglancer.

rmorey avatar rmorey commented on May 30, 2024

@jbms

There are a few different issues mentioned here. Can you clarify which ones you are referring to?

from our perspective, the only issue is the one you mention, that transparent meshes don't render.

One thing that isn't clear to me: the out of bounds memory access error --- does that still occur? How is that related to the meshes appearing or not and how does it relate to the opacity?

I originally posted that error because it came up, I don't know whether or not it's related. I can do some testing to see if it reliably shows up alongside the rendering issue.

I have no idea what the slash issue is, we're not seeing that.

from neuroglancer.

copypasteearth avatar copypasteearth commented on May 30, 2024

Oh the slash issue can be discarded, I am just wondering about opacity now

from neuroglancer.

copypasteearth avatar copypasteearth commented on May 30, 2024

@jbms @rmorey any solutions to this problem? I am still trying to get opacity and sihloetting to work with neuroglancer, but the meshes are just invisible on ipads

from neuroglancer.

jbms avatar jbms commented on May 30, 2024

@jbms @rmorey any solutions to this problem? I am still trying to get opacity and sihloetting to work with neuroglancer, but the meshes are just invisible on ipads

Can you provide the contents of the webgl2 tab on webglreport.com?

Unfortunately I don't have a convenient way to test out iOS safari.

The code for transparent rendering is here:

gl.clear(WebGL2RenderingContext.COLOR_BUFFER_BIT);

The likely candidates for the issue are:

  1. A problem with rendering to a R32F texture (
    this.gl, WebGL2RenderingContext.R32F, WebGL2RenderingContext.RED,
    ), which is used to accumulate the transparent rendering information.
  2. A problem with copying it back to the main buffer, possibly something involving the stencil buffer.

You could try reading back the accumulation textures to see if it contains any non-zero values. You could also try changing the texture format from R32F / RED to RGBA32F / RGBA . The implementation might happen to support RGBA better.

from neuroglancer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.