Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glitches on Mobile #3

Open
miketucker opened this issue Feb 26, 2014 · 3 comments
Open

Glitches on Mobile #3

miketucker opened this issue Feb 26, 2014 · 3 comments

Comments

@miketucker
Copy link

When running on an ES 2.0 mobile device there are visual artifacts that are not present on the desktop version. I thought this could be a precision problem, but changing to 'highp' didn't seem to work. Could this be the actual math operations on the GPUs? Or the compiler maybe? Completely stumped.

photo 26-02-2014 21 31 09

@fluffyfreak
Copy link
Owner

Woah, this runs on mobile?!?

Firstly I'm amazed and curious what you're running it on and how you got it on there? I wrote this for desktop and developed it on Windows 7/8.1 with Visual Studio so not really surprised it's not running.

Are you using the master branch as a base? It needs texture lookup in the vertex shader to do the displacement. According a post on StackOverflow that might be a problem as your hardware may not have it implemented.

Let me know, maybe we can work around it.

@miketucker
Copy link
Author

haha, it's ES2.0 compatible, right? WebGL and mobile ES2.0 are usually pretty similar (with the exception of bugs like this)

Here's how I'm implementing below. Just grabbing the position from the vertex, and doing a color of the billow function. Leaning towards it being a precision problem, but defining all vec3s and floats as 'highp' didn't seem to help.

It's running as a GLSL shader in Unity, and the previous screen is from an iPad.

Looks fine on the desktop editor, see image:
screen shot 2014-02-27 at 08 47 54

varyin vec3 pos;

#ifdef VERTEX


void main()
{
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    pos = vec3(gl_Position.x,gl_Position.y,gl_Position.z);
}

#endif


#ifdef FRAGMENT


uniform float _Lacunarity;
uniform float _Roughness;
uniform float _Frequency;
uniform float _TimeOffset;
uniform int _Octaves;


void main()
{
    gl_FragColor = vec4(1) * billow_octavenoise(_Octaves, _Roughness, _Lacunarity, pos, _Frequency, _TimeOffset);
}

#endif
ENDGLSL

@fluffyfreak
Copy link
Owner

Hmm, that does look like a precision problem.
You're just using the noise part then none of the rest of the code?
Perhaps you can try a more densely tessellated cube?

The noise library I use is, with only a few additions or changes, just the one from Ashima so you might have better luck there or by asking on StackOverflow if that's the only part you're using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants