0
サーフェスオブジェクトの配列のすべての頂点を含む頂点バッファオブジェクトがあります。各オブジェクトは異なるテクスチャを使用することができます。ブラウザでは最大16までサポートされます。私の問題は、ほとんどのサーフェス上でインターレースされたちらつきを取得することです。 専用GPUでWebglテクスチャのインターレースフリッカが発生する
precision mediump float;
varying vec2 texCoord;
varying float texNum;
uniform sampler2D texture0;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
uniform sampler2D texture4;
uniform sampler2D texture5;
uniform sampler2D texture6;
uniform sampler2D texture7;
uniform sampler2D texture8;
uniform sampler2D texture9;
uniform sampler2D texture10;
uniform sampler2D texture11;
uniform sampler2D texture12;
uniform sampler2D texture13;
uniform sampler2D texture14;
uniform sampler2D texture15;
void main(void){
if(texNum == 0.0){
gl_FragColor = texture2D(texture0,texCoord);
}else if(texNum == 1.0){
gl_FragColor = texture2D(texture1,texCoord);
}else if(texNum == 2.0){
gl_FragColor = texture2D(texture2,texCoord);
}else if(texNum == 3.0){
gl_FragColor = texture2D(texture3,texCoord);
}else if(texNum == 4.0){
gl_FragColor = texture2D(texture4,texCoord);
}else if(texNum == 5.0){
gl_FragColor = texture2D(texture5,texCoord);
}else if(texNum == 6.0){
gl_FragColor = texture2D(texture6,texCoord);
}else if(texNum == 7.0){
gl_FragColor = texture2D(texture7,texCoord);
}else if(texNum == 8.0){
gl_FragColor = texture2D(texture8,texCoord);
}else if(texNum == 9.0){
gl_FragColor = texture2D(texture9,texCoord);
}else if(texNum == 10.0){
gl_FragColor = texture2D(texture10,texCoord);
}else if(texNum == 11.0){
gl_FragColor = texture2D(texture11,texCoord);
}else if(texNum == 12.0){
gl_FragColor = texture2D(texture12,texCoord);
}else if(texNum == 13.0){
gl_FragColor = texture2D(texture13,texCoord);
}else if(texNum == 14.0){
gl_FragColor = texture2D(texture14,texCoord);
}else if(texNum == 15.0){
gl_FragColor = texture2D(texture15,texCoord);
}
if(gl_FragColor.a < 0.1) discard;
}
は今、ここに契約だ
は、ここに私のフラグメントシェーダです。これは、インテグラHD統合グラフィックのマシンでは完全に動作します。どんなちらつきもありません。これは私がデスクトップ上でgtx 770 dedicated gpuを実行した場合にのみ発生します。
なぜですか?どうやって?
高精度を使用して、および/または整数 –
にキャストしてみてください@ LJ大変ありがとうございました。これは私の問題を解決しませんでしたが、あなたは私に検索の道を与えました。私は私の解決策を掲載します。 –