0
我不知道copyteximage2D是如何工作的, 我想在WebGL的狀態機的任期解釋:copyteximage2D在狀態機方面
感謝GMAN我有這樣的:
gl = {
activeTextureUnit: 0,
textureUnits: [],
};
gl.activeTexture = function(unit) {
this.activeTextureUnit = unit - this.TEXTURE_0;
};
gl.bindTexture = function(bindPoint, texture) {
var textureUnit = this.textureUnits[this.activeTextureUnit];
switch (bindPoint) {
case this.TEXTURE_2D:
textureUnit.texture2D = texture;
break;
case ....
}
};
gl.copyTexImage2D = function(target, level, iformat, x, y, w,h,b) {
.....
..... gman please your code here thanks very much!!!
.....
}
不錯!所以,如果,在gl.copyTex之前..我把'fbPV2 = gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER,fbPV2); gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,pvTex2,0); '所以pvTex2會複製到綁定到當前紋理單元的紋理? –
是的'pxTex2'將成爲您決定複製TexImage2D到任何紋理的源代碼。 – gman
好!現在我面臨着另一個問題:pvTex2是一個浮動紋理。它似乎可能是問題?或者可能是問題在於我沒有在copyTexImage2D之後製作generatemimap(或設置過濾器)? –