We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
private static String getGaussianSampleCode() {
StringBuilder sb = new StringBuilder(); sb.append(" int diameter = 2 * uRadius + 1; \n") .append(" vec4 sampleTex;\n") .append(" vec3 col; \n") .append(" float weightSum = 0.0; \n") .append(" for(int i = 0; i < diameter; i++) {\n") .append(" vec2 offset = vec2(float(i - uRadius) * uWidthOffset, float(i - uRadius) * uHeightOffset); \n") .append(" sampleTex = vec4(texture2D(uTexture, vTexCoord.st+offset));\n") .append(" float index = float(i); \n") .append(" float gaussWeight = getGaussWeight(index - float(diameter - 1)/2.0,") .append(" (float(diameter - 1)/2.0 + 1.0) / 2.0); \n") .append(" col += sampleTex.rgb * gaussWeight; \n") .append(" weightSum += gaussWeight;\n") .append(" } \n") .append(" gl_FragColor = vec4(col / weightSum, sampleTex.a); \n"); return sb.toString(); }
如上:vec3 col的写法最好写成vec3 col = vec3(0.0,0.0,0.0);主动进行初始化,否则在一些机型上会有问题,导致最终渲染效果不正确
The text was updated successfully, but these errors were encountered:
Fix compatibility issue (#14)
44cd284
已修复,感谢提醒
Sorry, something went wrong.
No branches or pull requests
private static String getGaussianSampleCode() {
如上:vec3 col的写法最好写成vec3 col = vec3(0.0,0.0,0.0);主动进行初始化,否则在一些机型上会有问题,导致最终渲染效果不正确
The text was updated successfully, but these errors were encountered: