<p dir="ltr">Hi,</p>
<p dir="ltr">&gt; Why did you do this, what problem does it solve? It doesn&#39;t seem like<br>
a good idea to mix these things.</p>
<p dir="ltr">Simply put it was as a test/prototype to see if we could consider this approach.</p>
<p dir="ltr">I was familiar with this part of the code (camera, projection, ...) and thought (correctly so) that it would be straightforward to do. It does work by the way, even if it&#39;s not an optimal design. This has the advantage of adding little extra code to Cycles, since it benefits from the entire rendering pipeline. I assumed I could access the final renderresult inside Cycles though. Anyways.</p>

<p dir="ltr">I may write the barycentric to local function just to have results I could use to test again the real implementation. But I&#39;ll look shortly at &quot;creating a dedicates kernel function for baking&quot;.</p>

<p dir="ltr">I won&#39;t be on irc today, but if you can be on tomorrow I&#39;m sure I could use a hand on using/creating a kernel function for that.</p>
<p dir="ltr">Thanks,<br>
Dalai</p>
<div class="gmail_quote">On Jan 16, 2014 12:40 PM, &quot;Brecht Van Lommel&quot; &lt;<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
On Thu, Jan 16, 2014 at 1:04 AM, Dalai Felinto &lt;<a href="mailto:dfelinto@gmail.com">dfelinto@gmail.com</a>&gt; wrote:<br>
&gt; 1) How to convert UV Barycentric to world coordinates?<br>
&gt; uv_barycentric_to_world() in blender_camera.cpp<br>
&gt;<br>
&gt; I assume Cycles may already have something for that?<br>
&gt; If not, could you land me a hand on this?<br>
<br>
There isn&#39;t really a function for this outside the kernel, but why do<br>
you need this here? You should pass the UV coordinates to the kernel,<br>
and in the kernel it can then map them to world coordinate on the<br>
surface of the mesh. If you look at kernel_displace.h, there it calls<br>
shader_setup_from_displace with UV coordinates, and then ShaderData.P<br>
will be the world space position.<br>
<br>
&gt; 2) How to access engine.re-&gt;result from Cycles?<br>
&gt; (I need that for the populate_bake_result() in blender_session.cpp )<br>
&gt; This I should be able to find by myself later, but I thought I may as<br>
&gt; well ask ;)<br>
<br>
Not sure what you need this for, but the typical way is to call<br>
b_engine.begin_result() and then it gives you a temporary RenderResult<br>
for the tile, which will be merged back into the main one which is not<br>
directly accessed.<br>
<br>
For baking you shouldn&#39;t need access to a RenderResult, it shouldn&#39;t<br>
exist then as far as I know?<br>
<br>
&gt; 4) Some Notes:<br>
&gt;<br>
&gt; I decided to use the render structure for the baking (instead of<br>
&gt; mimicking the importance sampling code). For that I created a new<br>
&gt; internal camera type (BAKE) and I feed the camera with a few lookup<br>
&gt; tables for the position and direction of the rays.<br>
<br>
Why did you do this, what problem does it solve? It doesn&#39;t seem like<br>
a good idea to mix these things. You could prototype the code like<br>
this, but it shouldn&#39;t be difficult to create a dedicated kernel<br>
function for baking.<br>
<br>
Brecht.<br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</blockquote></div>