Hi Sam,<div><br></div><div>Great, this seemed to have worked. With a bit of tweaking, I'm able to basically recreate my original rendering: <a href="http://i.imgur.com/D8z0oFg.png">http://i.imgur.com/D8z0oFg.png</a> Thanks for fixing this!</div>
<div><br></div><div>-Noel<br><br><div class="gmail_quote">On Wed, Jul 10, 2013 at 12:54 PM, Sam Skillman <span dir="ltr"><<a href="mailto:samskillman@gmail.com" target="_blank">samskillman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Noel,<div><br></div><div>Thanks for bringing this up.  I'm afraid I messed up (or really never had it right to begin with!) how rgba channels are blended when using grey_opacity=True renders.  I've posted a PR here: <a href="https://bitbucket.org/yt_analysis/yt/pull-request/553/fix-for-grey_opacity-grid-line-drawing/diff" target="_blank">https://bitbucket.org/yt_analysis/yt/pull-request/553/fix-for-grey_opacity-grid-line-drawing/diff</a> that resolves this problem for me.  I don't expect it to take too long to be reviewed and pulled in to the main repository, but if you are in a hurry feel free to pull down the changes and test it out yourself. If you aren't familiar on how to do that, please let me know.</div>


<div><br></div><div>Best,</div><div>Sam</div><div><br></div><div>BTW, very nice volume rendering!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Tue, Jul 9, 2013 at 4:53 PM, Noel Scudder <span dir="ltr"><<a href="mailto:noel.scudder@stonybrook.edu" target="_blank">noel.scudder@stonybrook.edu</a>></span> wrote:<br>


</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hi yt users,<div><br></div><div>I'm having a lot of trouble recreating a volume rendering I did a couple of weeks ago. Specifically, when I try to add</div>


<div>a boundary box to my snapshot through draw_domain() or grids through draw_grids(), the transfer function rendering fades very significantly, regardless of alpha value, and it did not behave this way before. </div>


<div>However, it does not fade for cam.draw_box(... , ... , np.array([0.1, 0.1, 0.1, 0.2]) . Since draw_domain is basically just a call to draw_box, I took a look in camera.py and did a bit of testing, and the only difference is that the color array is np.array([1.0,1.0,1.0,alpha]) (where alpha=0.2) for draw_domain, and that is what seemed to be causing so much fade in the case of draw_domain. I didn't experience this problem before. Also, I don't know much about how this color stuff works, but I was under the impression that only the alpha value determined how bright the box is compared to the rendering underneath. Furthermore, when I decrease the alpha value, the box fades, but so does the rendering underneath, which should not be the case (?).</div>





<div><br></div><div>I see the same behavior when doing draw_grids. Here is the image I created a couple of weeks ago: <a href="http://i.imgur.com/R0uhz2D.png" target="_blank">http://i.imgur.com/R0uhz2D.png</a></div><div>




And here is the image that the same script (very nearly) creates now: <a href="http://i.imgur.com/xcTmCMC.png" target="_blank">http://i.imgur.com/xcTmCMC.png</a></div>
<div>The rendering underneath the grids is nearly invisible in the second one. If I stack another draw_grids onto the image after this, for a different level range, the rendering goes completely invisible, and the first set of grids almost does-- again, even with alpha values of ~0.05.</div>




<div><br></div><div>For reference, here is the script I'm using:</div><div><br></div><div>-----------------------</div><div><div>from yt.mods import *</div>
<div>pf = load("plt_derr_perr_grav_00020")</div><div>field = "pressure"</div><div>[variable definitions, cut out for clarity]</div><div><br></div><div>pf.h</div><div>pf.field_info[field].take_log=True</div>




<div><br></div><div>tf = ColorTransferFunction((mi-1, ma+1), nbins=1.0e6)</div><div><br></div><div>tf.sample_colormap(np.log10(2.0e21), 0.006, col_bounds=[mi,ma],</div>
<div>                   alpha=[55.0], colormap="RdBu_r")</div><div><br></div><div>tf.add_layers(6, mi=di, ma=da,</div><div>              col_bounds=[pu,da],</div><div>              alpha=26*na.ones(6,dtype='float64'), colormap="RdBu_r")</div>




<div><br></div><div>[more layers, cut out for clarity]</div><div><br></div><div>tf.grey_opacity=True</div>
<div><br></div><div><br></div><div>c = [5.0e9, 5.0e9, 5.0e9]</div><div>L = [0.15, 1.0, 0.4]</div><div>W = (pf.domain_right_edge - pf.domain_left_edge)*1.25</div><div>Nvec = 768</div><div><br></div><div>cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = tf,</div>





<div>                  fields=[field], pf=pf, no_ghost=False)</div><div>im = cam.snapshot(clip_ratio=6.0)</div><div><br></div><div><br></div><div>im.add_background_color('black', inline=True)</div>
<div>cam.draw_box(im, np.array([3.0e9, 4.0e9, 4.0e9]),</div><div>             np.array([7.0e9, 6.0e9, 6.0e9]), np.array([0.1, 0.1, 0.1, 0.2]))</div><div><br></div><div>nim = cam.draw_grids(im, alpha=0.08, min_level=1)</div>





<div><br></div><div>nim.write_png('v1.png')</div></div><div>-----------------------</div><div><br></div><div>Am I doing something wrong or missing something obvious? Was the behavior of draw_grids and draw_domain changed with the new update? Thanks for your help!</div>


<span><font color="#888888">

<div><br></div><div>-Noel Scudder</div>
</font></span><br></div></div><div class="im">_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>