本文介绍了在三星Galaxy SIII噪声算法失败(GLES)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我努力让下一个简单的算法,在三星Galaxy SIII的工作

I am struggling to get the next simple algorithm working in the Samsung Galaxy SIII

float rand(vec2 co)
{
    return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

....
vec3 color = texture2D(u_texture, v_texcoord);
gl_FragColor.rgb = color + vec3(rand(gl_FragCoord.xy + time / 1000.0));
....

在code产生完美的三星Galaxy S1和谷歌Nexus S.预期的噪音,但它完全失败,在新的智能手机,它使用了ARM的Mali-400 / MP4。

The code generates perfectly the expected noise in Samsung Galaxy S1 and Google Nexus S. But it fails completely in the new smartphone which uses ARM's Mali-400/MP4.

任何人都可以发现什么不对这个算法?或者,也许明白为什么会失败?

Anyone can spot anything wrong with this algorithm? Or maybe understand why could it fail?

推荐答案

您的问题可能来自于服用一个大数目的的罪。这样做的结果取决于的罪,这是无法确切落实。所用的马里芯片显然的罪函数有更多的predictable结果与大数字比其他人。

Your problem likely comes from taking the sin of a big number. The result of this depends on the exact implementation of sin, which is not available. Obviously the sin function used by the Mali chip has more predictable results with big numbers than the others.

在我看来,你应该使用一个的实际的噪音的功能,不这东西。至少它会有predictable结果跨硬件。

It seems to me that you should use an actual noise function, not this thing. At least it will have predictable results across hardware.

这篇关于在三星Galaxy SIII噪声算法失败(GLES)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-11 22:18