Texture loading doesn't work on Xiaomi phones
See original GitHub issueAfter adding the default noise texture via ‘Add uniform/texture’ menu and filling out the rest of the method that tiles the noise texture all over the screen, the app renders a black shader instead of repeating the texture. I’m not well familiarized with OpenGL, so apologies, if I’m doing something wrong. This issue has been reproduced on Xiaomi Mi4c and Xiaomi Redmi 4 Prime/Pro. The code that does the tiling itself is below.
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform sampler2D noise;
void main( void )
{
vec2 tempPos= vec2(mod(gl_FragCoord.x,256.),mod(gl_FragCoord.y,256.));
vec3 uv = texture2D(noise, tempPos).rgb;
gl_FragColor = vec4( uv, 1.0 );
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to enable Paper Reading Mode in Xiaomi phones
Enable Reading Mode. Tap on Paper. Press the small arrow button on the right-side of the Paper option. Adjust Color temperature and Texture....
Read more >Android OpenGL some Texture not loading/reloading
I seem to have a bit of a strange problem, on one phone two textures dont load up at all as they appear...
Read more >Android export for GLES2 doesn't include textures unless ETC ...
I'm testing a project I was developing in 3.0, just imported the whole thing into 3.1 alpha 2. I get a whole bunch...
Read more >Xiaomi buyer's guide: Everything you need to know
Looking to buy something from Xiaomi but you don't know much about the brand? Here is a roundup of everything you need to...
Read more >Phasmophobia not loading or throws 'Game Does Not Exist ...
Troubleshooting methods like verifying game files, lowering resolution/textures, using a VPN, and uninstalling and reinstalling the game don't ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The docs.gl page could be included in the Readme to help old and new GLSL users 😉
The variable
gl_FragCoord
has the coordinates of your screen in pixels, it means that the integer part of them will be usable (e.g 1920*1080 -> vec2(1920.0,1080.0)) Dividing it by your resolution will return value between 0.0 and 1.0. This normalized value can be used to sample the texture. As you want to use the texture as sampling, use it’s resolution to divide the coordinates:ShaderEditor is set up to repeat your texture, so you actually don’t have to use the modulo function. This isn’t a GLSL setting, it’s an OpenGL setting. It would be nice to have different repeating/clamping settings, but in your case it will work as you want it.
PS: welcome to OpenGL and GLSL 😃