21
$\begingroup$

EDIT For now, I'm going to accept Brett's answer. It's a way to get transparency back by having 3D calculations done in software instead of hardware. It addresses the symptoms but not the causes. As I wrote above, my PC and graphics card are provably able to do it, but there's something in the interaction with MMA that disables it after restarts. Anyone who solves this gets the Accept check.


Edit I got conformations from several users with the following hardware:

  • Simon Woods: Windows 7 64 bit, with an NVidia GTX 550 Ti graphics card.
  • texasAUtiger: Windows 7, 64 bit on Intel on Intel iCore i7-2760QM 2.4 ghz, NVidia NVS 4200M graphics card

I have this problem where several of the examples in the doc page of Texture don't work.

data = Table[{1, 0, 0, a}, {u, 0, 1, 1/100}, {a, 0, 1, 1/100}];

vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 
     0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 
     1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 
     1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{0, 0, 
     1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};

Graphics3D[{Texture[data], 
  Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}, 
 Lighting -> "Neutral", Boxed -> False]

is supposed to give:

Mathematica graphics

but I get this:

Mathematica graphics

data1 = Table[{1, 2/3, 0, If[u^2 + v^2 < 1/2, 0, 1]}, {u, -1, 1, 
    1/100}, {v, -1, 1, 1/100}];
data2 = Table[{0, 0, 1, If[u^2 + v^2 < 1/2, 0, 1]}, {u, -1, 1, 
    1/100}, {v, -1, 1, 1/100}];

Additionally,

Graphics3D[{FaceForm[Texture[data1], Texture[data2]], 
  Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}, 
 Lighting -> "Neutral", Boxed -> False]

should yield:

Mathematica graphics

but I get the empty cube again.

Then there's the example in the Scope>Texture styling section of the doc page which is supposed to result in:

enter image description here

In my case I get:

Mathematica graphics.

This is not a general transparency issue as

Plot3D[x^4 + y^4 - 5 x^2*y^2, {x, -3, 3}, {y, -3, 3}, 
 PlotStyle -> Opacity[0.8], Mesh -> None]

gives me this:

Mathematica graphics

I'm using a 1 year old Dell XPS-15 (model L501 X)Running Windows 7-64 with an nVidia GeForce GT 435M graphics card, driver version 8.17.12.6639.

I reported this earlier on Mathgroup and got the advice to update my drivers which I did and it sure helped. However this is not the end of the story as the behavior returned soon afterwards.

I have updated the driver various times using both nVidia's and Dell's newest version and it always was a short-lived solution. Last time I tested it, I installed the same version of the driver over the existing one and the transparent textures showed up as intended in my notebook even without re-executing the code, only to disappear after MMA's next restart.

So, apparently my system is able to handle transparent textures but there is some interaction between MMA and the driver that causes this ability to be switched off.

Update

This issue seems to have been resolved in Mathematica 9. All of the above mentioned problems did not reappear when I tested them in the trial version of V9.

$\endgroup$
3
  • 1
    $\begingroup$ I'm curious to know if this issue has been fixed in version 9? $\endgroup$ Commented Dec 5, 2012 at 10:51
  • 1
    $\begingroup$ @SimonWoods It works for me now. And for you? $\endgroup$ Commented Dec 5, 2012 at 13:50
  • $\begingroup$ I had this problem in V8. It is fixed for me in V9. $\endgroup$
    – david
    Commented Dec 5, 2012 at 14:50

1 Answer 1

20
$\begingroup$

Go into the option inspector, and try the different settings for Graphics Options > RenderingOptions > "Graphics3DRenderingEngine and see if that has any effect.

Edit This option can be set on a per-graphic basis, say by using Style:

AbsoluteTiming[
   Rasterize[
    Style[Graphics3D[{Opacity[0.1], 
       Sphere[{0, 0, 0}, #] & /@ Range[20]}, ImageSize -> 200], 
     RenderingOptions -> {"Graphics3DRenderingEngine" -> #}]]] & /@
{"BSPTree", "HardwareDepthBuffer"}

Mathematica graphics

$\endgroup$
4
  • $\begingroup$ Thanks! The BSPTree option seems to work. Is that a software solution? That is, does it cause software rendering or is this just a setting of the graphics card? The cube with holes is dead slow; so slow even that it apparently causes some kind of time-out. Other mma windows pop-up from behind its window when I drag the cube around a bit. And why would a fresh driver installation work temporarily? $\endgroup$ Commented Jan 18, 2012 at 20:45
  • 1
    $\begingroup$ BSPTree is software, and can be quite slow, but can also be much more accurate about rendering the scene than some of the other methods. I have no idea why installing drivers would have an effect. $\endgroup$ Commented Jan 18, 2012 at 20:57
  • $\begingroup$ Is it possible to Rasterize a graphic with a custom setting for this? Is the proper way copying the graphic to a hidden notebook, setting notebook-level options for the rendering engine, and then using Rasterize on the notebook? $\endgroup$
    – Szabolcs
    Commented Jan 19, 2012 at 10:40
  • $\begingroup$ @Szabolcs Yes. See the updated answer. $\endgroup$ Commented Jan 21, 2012 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.