2010-08-27 4 views
0

Je travaille à la galerie sur O3D (version plagin) et j'ai besoin de rendre les photos transparentes. Les photos sont sur hud. Voici un code:textures o3d et transparence

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(); 

Mais cela ne fonctionne pas. Lors du réglage paramOne.value = affiche photo BLENDFUNC_ZERO (non transparent)

paramOne.value = BLENDFUNC_ONE photo est pas affichée (plein transparent)

Alors, comment ACHIVE résultat intermédiaire?

Répondre

0

Étant donné que le plug-in O3D est déprécié au profit du WebGL-based O3D, est-ce que vous avez la possibilité de le faire en migrate to the latter?

Si c'est le cas, vous pouvez vous renseigner dans le discussion group sur le problème de transparence (s'il existe toujours sous O3D-WebGL). Les développeurs sont très réactifs.