[Tex/LaTex] Pgfplots: 3D plot with shader=interp and opacity

pgfplotstransparency

I have a rather simple question : is there a way to use shader=interp with an opacity factor in a surf mesh ? Here is an example that does not work:

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\def\h{1.5}
\def\mult{4}

\begin{tikzpicture}
\begin{axis}[xlabel=$x$,ylabel=$y$,view={20}{50},zmin=-4,zmax=4,
      variable=\s,variable y=\t,domain=0:1,hide axis,
      colormap={custom}{color(0)=(cyan) color(1)=(orange)}]

\def\triangleParamX{\s}
\def\triangleParamY{(1-\s)*\t}

\addplot3[black,mark=none] coordinates {(0,0,0) (0,1,0)};
\addplot3[black,mark=none] coordinates {(0,0,-\h) (0,0,\h)};
\addplot3[black,mark=none] coordinates {(0,0.5,-\h) (0,0.5,\h)};
\addplot3[black,mark=none] coordinates {(0,1,-\h) (0,1,\h)};
\addplot3[black,mark=none] coordinates {(0.5,0.5,-\h) (0.5,0.5,\h)};
\addplot3[black,mark=none] coordinates {(1,0,-\h) (1,0,\h)};
\addplot3[opacity=0.5,surf,shader=interp] (\triangleParamX,\triangleParamY,\mult*1-\mult*3*x-\mult*3*y+\mult*4*x*y+\mult*2*x*x+\mult*2*y*y);
\addplot3[black,mark=none] coordinates {(0,1,0) (1,0,0) (0,0,0)};
\addplot3[black,mark=none] coordinates {(0.5,0,-\h) (0.5,0,\h)};

\end{axis}
\end{tikzpicture}

\end{document}

It produces the following result:

shader=interp, opacity does not work

However, if you just replace shader=interp with shader=flat in the latter example, you get the following:

shader=flat, opacity works

Here, opacity works, but I do not want the lines on the surface. Is there a trick to make this work ?

Cheers

Best Answer

Ok, this is not really an answer, but more kind of an evolution of the situation. I recently updated Adobe Reader, and now the shader=interp works with opacity (see picture). It is however still not okay in other viewers.

Thanks for everyone's time anyway ! :)

enter image description here

Related Question