<div dir="ltr">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.<div><br></div><div>In general it&#39;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.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 27, 2017 at 9:25 AM, Dylan McDiarmid <span dir="ltr">&lt;<a href="mailto:dylanmcd@gmail.com" target="_blank">dylanmcd@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US"><div class="m_202001414291596543WordSection1"><p class="MsoNormal">I&#39;m doing some work that involves mapping textures post-render, and I&#39;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"><u></u> <u></u></p><div><p class="MsoNormal">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&#39;re doing our mapping, this puts the UV at a completely wrong place.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">To properly represent the antialiasing at places that self-overlap, we need 5 values, bottom U, bottom V, top U, top V, top opacity. I don&#39;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?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I&#39;ve done a bit of poking around to the source, but I&#39;m afraid I&#39;ve been hindered by a lack of domain knowledge. It seems that the pass information is being read from<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">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_<wbr>map.fetch(index)<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">but I&#39;m having trouble figuring out where and when __attributes_map gets filled (and with what, and why :).<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">As a newcomer to graphics programming, it&#39;s a real pleasure to find such a great renderer that I can actual read the source to. So thanks to everyone involved.<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p></div></div><br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br></div>