o3d纹理和透明度

时间:2010-08-27 20:58:01

标签: graphics transparency textures hud o3d

我正在使用o3d(plagin版本)galery工作,我需要让照片透明化。照片正在进行中。这是一些代码:

g_canvasInfoPict = o3djs.canvas.create(g_pack, g_hudRoot, g_hudViewInfo);

alphaParam = g_canvasInfoPict.transparentState_.getStateParam("o3d.AlphaReference");
alphaParam.value = 0.5;

alphaParam = g_canvasInfoPict.transparentState_.getStateParam("o3d.BlendAlphaEquation");
alphaParam.value = g_o3d.State.BLEND_SUBTRACT;

alphaParam = g_canvasInfoPict.transparentState_.getStateParam("o3d.SourceBlendFunction");
alphaParam.value = g_o3d.State.BLENDFUNC_ONE;

paramOne = g_canvasInfoPict.transparentState_.getStateParam("o3d.DestinationBlendFunction");
paramOne.value = g_o3d.State.BLENDFUNC_DESTINATION_ALPHA;//or BLENDFUNC_SOURCE_ALPHA or BLENDFUNC_SOURCE_ALPHA_SATUTRATE or BLENDFUNC_ONE or BLENDFUNC_ZERO

g_fullPictCanvas = g_canvasInfoPict.createXYQuad(paddingX, paddingY, -14, g_fullPictTexture.width, g_fullPictTexture.height, true);

g_fullPictCanvas.canvas.drawBitmap(g_fullPictTexture, 0, g_fullPictTexture.height);
g_fullPictCanvas.updateTexture();

但它不起作用。设置paramOne.value = BLENDFUNC_ZERO照片时显示(非透明)

paramOne.value = BLENDFUNC_ONE照片未显示(完全透明)

那么如何实现中间结果?

1 个答案:

答案 0 :(得分:0)

鉴于O3D插件已被弃用而不支持WebGL-based O3D,您可以选择migrate to the latter吗?

如果是这样,您可以在discussion group中查询透明度问题(如果它仍然存在于O3D-WebGL下)。开发人员非常敏感。