<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Thank for the info, Brecht. I’ll keep the downsampling solution as a last resort, and try implementing a pass that gives me enough information to do the compositing operations in post. I don’t need to support blur or DOF, but overlapping transparency is a possibility I didn't think of. </p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Now that I know I’ll need to hack this together, I’ll work on getting a good development environment setup and familiarizing myself with the code. If Blender did support deep EXR, what would your high-level strategy be for implementing this feature for a solo object render? Is there a single place where the UV Pass is written, or is this something that happens from multiple places?</p><p class=MsoNormal> </p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brechtvanlommel@pandora.be">Brecht Van Lommel</a><br><b>Sent: </b>Friday, July 28, 2017 8:03 PM<br><b>To: </b><a href="mailto:bf-cycles@blender.org">Discussion list to assist Cycles render engine developers</a><br><b>Subject: </b>Re: [Bf-cycles] UV Pass and Self Overlap</p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>There is currently no good way to output such information. Rendering in a high resolution and then scaling down may be the best way to try to recover this information. Modifying the code to write only the first sample might help with that, like we do for the Z pass.</p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>In general it's not just &quot;top&quot; and &quot;bottom&quot;, but rather an arbitrary number of objects that might contribute to a pixel, either due to antialiasing, transparency, depth of field or motion blur. A better solution to this is deep EXR, which we do not support currently.</p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Thu, Jul 27, 2017 at 9:25 AM, Dylan McDiarmid &lt;<a href="mailto:dylanmcd@gmail.com" target="_blank">dylanmcd@gmail.com</a>&gt; wrote:</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='margin-left:4.8pt'>I'm doing some work that involves mapping textures post-render, and I'm trying to figure out how to get anti-aliasing information out of the UV pass. From the UV pass EXR, it looks like for edges that overlap the background, we get a nice B value that indicates opacity. So, to find the actual UV position we would do U = R / B, V = G / B, and then do an alpha blend with what we want as the background using the B value.</p><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p><div><p class=MsoNormal style='margin-left:4.8pt'>However, when an object overlaps itself, the B value stays at 1, and instead we get the actual alpha blend of the top R,G with the bottom R,G. So when we're doing our mapping, this puts the UV at a completely wrong place.</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>To properly represent the antialiasing at places that self-overlap, we need 5 values, bottom U, bottom V, top U, top V, top opacity.&nbsp;I don't know HDR formats very well, are these values already being captured somewhere in some kind of metadata field? If not, is there currently a way to do a separate pass to capture this information?</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>I've done a bit of poking around to the source, but I'm afraid I've been hindered by a lack of domain knowledge. It seems that the pass information is being read from</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>kernel_passes.h : kernel_write_data_passes -&gt; geom_primitive.h : primitive_uv -&gt; geom_attribute.h : find_attribute -&gt; kernel_compat_cpu.h: kernel_tex_fetch -&gt; KernelGlobals-&gt;__attributes_map.fetch(index)</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>but I'm having trouble figuring out where and when __attributes_map gets filled (and with what, and why :).</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div><div><p class=MsoNormal style='margin-left:4.8pt'>As a newcomer to graphics programming, it's a real pleasure to find such a great renderer that I can actual read the source to. So thanks to everyone involved.</p></div><p class=MsoNormal style='margin-left:4.8pt'>&nbsp;</p></div></div><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:4.8pt'><br>_______________________________________________<br>Bf-cycles mailing list<br><a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br><a href="https://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">https://lists.blender.org/mailman/listinfo/bf-cycles</a></p></blockquote></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>