Safari iOS 8 experiencing issues with loading WebGL image textures

The example mentioned above runs smoothly on all major browsers, including Safari on Mac OS. However, it fails to display the correct image on my iPad running the latest iOS 8. Click here for the example.

Similarly, the tutorial provided in the following link does not work properly on iOS 8 either.

Tutorial link here.

What is the best way to showcase panoramic images in webgl on iOS devices?

Answer №1

Check out on iOS and you'll notice that it shows a "Max Texture Size: 4096". Although iOS does support panorama images up to 4096*2048, there seems to be a bug in three.js. My testing has revealed that if a panorama image exceeds the size of 4096, it will automatically scale down to 4096*2048 and render correctly. However, when the image size is exactly 4096*2048, scaling doesn't occur and rendering issues arise.

To address this issue, a simple modification can be made to the function clampToMaxSize in three.js:

Instead of

if ( image.width > maxSize || image.height > maxSize ) {

Use

if ( image.width >= maxSize || image.height >= maxSize ) {

This change allows for proper scaling of images with dimensions 4096*2048. The key operation in the clampToMaxSize function is:

context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );

Answer №2

When it comes to mobile devices, they have limitations in terms of texture sizes compared to desktop browsers. In the

webgl_panorama_equirectangular.html
example, the texture size is 4096x2048, which may be too large for mobile devices. It's recommended to decrease the texture size while ensuring it remains a power of two.

Answer №3

When designing for IOS8 Safari, keep in mind that the maximum texture size is 2048x2048. For panoramic images, a resolution of 2048x1024 with a skybox using six 1024x1024 textures can provide better performance and visual quality.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with rendering points in React-three-fiber

Recently, I started diving into the world of React-three-fiber and attempted to render some points on the canvas. Despite finding code snippets online, I'm facing an issue where the points are not being rendered on the canvas. Here's the code sn ...

Randomly positioning an image while the page is loading

I've been developing a portfolio website to showcase my design work, but I've encountered a minor issue. My goal is to have the images load in random positions and then make them draggable using Dragabilly. However, sometimes all the images end ...

Sinusoidal mesh plot fails to appear due to custom settings

Encountering an exception: The null object is unable to utilize the '+' method. The error described above arises while executing the subsequent function responsible for plot calculations and rendering: initGraph() { var RANGE = 10, I ...

Enhancing website functionality with Regex in Javascript

So, here is the code I am working with: var patt = new RegExp("/.+/g"); var device_id = patt.exec("javascript:project_id:256, device_id:2232"); Surprisingly, after running the above code, the value of device_id is empty and I can't seem to figure ou ...

Creating a dynamic className string in JavaScript with React

In my current project, I'm implementing mobile support by creating separate styles for desktop and mobile. Although most components are the same on both platforms, I have two .scss files dedicated to each. To apply the correct styles, I use a combina ...

Building a PathString Tree

I encountered a similar issue like the one discussed in this post (Get a tree like structure out of path string). I attempted to implement the suggested solution but I am facing difficulties getting it to work within an Angular context. The concept involv ...

Turn on / off Button Using a Different Button

I am currently working on an application that is designed to create teams using button selectors. There are two initial teams in play: the (available team) which consists of two buttons - one for selecting a player and populating the player name into the ( ...

Using the Position Sticky feature in Next.js

As a newcomer to sticky elements, I decided to implement a sticky sidebar in my project. Unfortunately, after copying and pasting some code snippets related to sticky sidebars, it seems that the functionality is not working as expected. <Layout title= ...

Attempting to create an auto-suggestion tool that can process and accept multiple input values, filtering out only those that begin with a designated character

I've been working on implementing an auto-suggestion feature that displays suggestions with partial matches or values within the input box. The goal is for it to only provide suggestions that begin with a specific character, like the "@" symbol. Fo ...

Find the total number of records in fnClick: (datatables.net)

I am struggling with some code where I need to retrieve the total number of records. I posted about it on the datatables.net forum but unfortunately, no one was able to help me... tableTools: { "sSwfPath": window.STATIC_BASE + "scripts/datatable/s ...

Combine an array nested within an object with each key of the object

Alright, let's dive into the structure of these objects: custom_fields:{ 21:{ edit:true required:true show:true } } In my Angular controller, this object is stored under $scope.page.custom_fields. Within this object, there is another ...

inserting a for-loop inside a div tag

I've created a script that modifies the background color and plays a sound in response to user input. The changes are triggered by the length of the input provided. Additionally, I have a div element where I aim to display the specific letter causing ...

Manipulating events through adjusting values of a JQuery-UI range-slider

My range-slider's values are being set with the code: $('...').slider( 'values', [ 0, 10000 ] );. However, I am facing an issue where this line triggers the change( event, ui ) event twice. Is there a way to ensure it only triggers ...

Getting the checked values from an AngularJS Material checkbox

<md-checkbox ng-repeat="program in ctrl.programs" ng-model="ctrl.programsSelected[program.id]"> {{program.name}} </md-checkbox> Checked Items: {{ctrl.programsSelected | json}} Current Output: Checked Items: [null,true,true,true,null,true, ...

What is the process by which node.js synchronously delivers a response to a REST web service?

Sorry if this question seems obvious! I'm struggling to grasp how node.js handles requests from the browser. I've looked at tutorials online where express.js was used to create the server-side code with node.js. Routes were then set up using prom ...

What is the best way to exclude React.js source files from a fresh Nest.js setup?

My setup includes a fresh Nest.js installation and a directory named "client" with a clean create-react-app installation inside. Here is the project structure: ./ ...some Nest.js folders... client <- React.js resides here ...some more Nest.js fo ...

Joi mistakenly demanding certain fields that should not be mandatory

I've encountered an issue with posts validation using @hapi/joi 17.1.1. In my schema, I have two fields: textfield and picture. Although both fields are not required, the validation is still indicating that the picture field is mandatory. posts valid ...

Creating a mandatory 'Select' component in Material UI with React JS

Is there a method to show an error message in red until a choice is selected? ...

Troubleshooting Type Conversion Error in ASP.NET MVC Controller

I have been working on an application that utilizes the following HTML and JavaScript. The user is required to input 5 props and then click on the 'Create' button. Subsequently, the JavaScript code compiles all of these props into a list before s ...

New solution for Java applet requiring communication with browser using JavaScript

Within our web platform, we have been utilizing a Java applet to interact with the MS Word application using jacob jar. This allows users to open, edit, and automatically upload files to the server upon saving. However, due to Google Chrome discontinuing ...