<div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">Hi Brecht, </span></div><div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><br>
</span></div><div><span style><b>-I don&#39;t think we should have a material normal output...</b></span></div><div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;background-color:rgb(250,250,250)"> </span></div>
<div><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;background-color:rgb(250,250,250)">Normal output is there mostly for convenience, my original idea was to implement a edge node effects, and for efficiency, output the normal was better than generate</span></div>
<div><span style="background-color:rgb(250,250,250)"><font color="#333333" face="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif">the bump mapping, (you know it gets executed 3 times with bump). </font></span></div><div>
<span style="background-color:rgb(250,250,250);color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">No problem if we don&#39;t implement that output, as long as we can at least add a new node that can allow us to modify the shader normal (ShaderData::N), or add/modulate to it, </span><span style="background-color:rgb(250,250,250);color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">I think it will be very convenient, than connecting each time bsdf when you want it applied globaly. </span></div>
<div><span style="background-color:rgb(250,250,250);color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">That node can also have some convenient options to transform to tangent/object space to write procedurals textures with vectors and apply to the mesh easily. and other normal related functions.</span></div>
<span style="background-color:rgb(250,250,250)"><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px"><br></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
<b><span style>-In svm_node_set_bump, the intensity can replace the fixed 0.1f </span><span style>value, rather than multiplying h_c, h_x, h_y...</span></b></div><div><font color="#333333" face="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif">Okay, i though about that too, but i wasn&#39;t sure, so then we should set the default Bump Intensity to 0.1 to not break backwards compatibility with previous scenes/expected behavior?</font></div>
<div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px"><span style><br></span></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
<span style><b>-The image node normal should never get sRGB =&gt; linear conversion</b></span></div><div><font color="#333333" face="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif">Thanks for clarify, my bad, any way that wasn&#39;t the proper implementation, just something quick to play with, proper implementation is using blender convention as i commented in the patch.</font></div>
<div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><br>
</span></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px"><span style><b>-I think normal inputs for BSDF&#39;s should get added on top of the</b></span></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
<span style>Got it.</span></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px"><span style><br></span></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
<b><span style>-Would be interesting to test if this affects performance, storing </span><span style>the normal per shader closure.</span></b></div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
Some blenderartist folks made some test with/without the patch and with the GPU. Four different materials A, B, C and D without using the new sockets only with displacement and without it:</div><div style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><br></span></div><font color="#333333" face="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif">@Bao2: ( linux, cuda 4.2 )</font></span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">A: 0.6 % performance lost   (diffuse, No bump)</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">B: 0.8 % performance lost   (</span><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">diffuse, </span><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">bump)</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">c: 0.7 % performance lost   (mixed glossy and diffuse, bump)</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">D: 1.0 % performance lost </span>  <span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">(mixed glossy and diffuse, no bump)</span> <br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">@kgeogeo: (didn&#39;t ask)</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">A: 2.0 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">B: 1.6 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">c: 2.9 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">D: 2.7 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">@rebogey (</span> WinXp 32, 
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;background-color:rgb(250,250,250)">cuda 4.2 </span> <span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">)</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">A: 2,1 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">B: 2,4 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">C: 2,6 % performance lost</span><br style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">
<span style="color:rgb(51,51,51);font-family:Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif;font-size:13px;background-color:rgb(250,250,250)">D: 2,3 % performance lost</span> <br><br>I still didn&#39;t test the CPU, i am writing you at 2am here, more death than alive. Hopefully this weekend i can sit down and finish it with your recommendations, trying to see if i can optimize it as much i can.<div>
<br>Thanks you Brecht</div><div><br></div><div>Agus.<br><br><br><br><div class="gmail_quote">2012/5/29 Brecht Van Lommel <span dir="ltr">&lt;<a href="mailto:brechtvanlommel@pandora.be" target="_blank">brechtvanlommel@pandora.be</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Nice, do not have time right now to review it closely, but some feedback:<br>
<br>
* I don&#39;t think we should have a material normal output, the<br>
displacement output is there because it can affect both the geometry<br>
and the shading. But for a shading only thing like normal maps I think<br>
we can just use BSDF sockets.<br>
* I think normal inputs for BSDF&#39;s should get added on top of the<br>
default normal from bump/displacement mapping.<br>
* The image node normal should never get sRGB =&gt; linear conversion,<br>
this is non-color data and should not be affected by color spaces. I<br>
also don&#39;t think the image node is the place to control normal map<br>
intensity, that should be done elsewhere, if it should be done at all<br>
for normal maps.<br>
* In svm_node_set_bump, the intensity can replace the fixed 0.1f<br>
value, rather than multiplying h_c, h_x, h_y.<br>
* Would be interesting to test if this affects performance, storing<br>
the normal per shader closure.<br>
<br>
Brecht.<br>
<div><div class="h5"><br>
On Tue, May 29, 2012 at 4:41 PM, Agustin Benavidez<br>
&lt;<a href="mailto:agustinbenavidez@gmail.com">agustinbenavidez@gmail.com</a>&gt; wrote:<br>
&gt; Hi Brecht,<br>
&gt;<br>
&gt; I was implementing a contour/bevel shader node, and i though it could<br>
&gt; convenient to have a input normal socket to connect the contour node there.<br>
&gt; Messing with the code i end up implementing per bsdf bump/normal mapping.<br>
&gt; here there are screenshots of the working patch: (the image nodes also have<br>
&gt; initial basic normal mapping support too)<br>
&gt;<br>
&gt; <a href="http://www.pasteall.org/pic/show.php?id=32464" target="_blank">http://www.pasteall.org/pic/show.php?id=32464</a><br>
&gt; <a href="http://www.pasteall.org/pic/show.php?id=32414" target="_blank">http://www.pasteall.org/pic/show.php?id=32414</a><br>
&gt; <a href="http://www.pasteall.org/pic/show.php?id=32412" target="_blank">http://www.pasteall.org/pic/show.php?id=32412</a><br>
&gt;<br>
&gt; Also if you want to take a quick look at the implementation details i attach<br>
&gt; you the patch too ( Is not meant to be for review, i still need to clean it<br>
&gt; up and make some stuff there better)  :<br>
&gt;<br>
&gt; <a href="http://dl.dropbox.com/u/65979653/BlenderComunityShare/Patchs/Own/NormalOutput_PerBSDFNormal_0.7.diff" target="_blank">http://dl.dropbox.com/u/65979653/BlenderComunityShare/Patchs/Own/NormalOutput_PerBSDFNormal_0.7.diff</a><br>

&gt;<br>
&gt;<br>
&gt; *) Whats left is to define if this is the right workflow. The initial idea<br>
&gt; is:<br>
&gt;<br>
&gt; N0: Normal input subgraph in the output node will define the first shader<br>
&gt; normal (ShaderData::N)<br>
&gt;<br>
&gt; N1: Displacement input in Output normal still makes bump mapping, it will<br>
&gt; make displacement and bump mapping as needed, the normal generated here is a<br>
&gt; modulation of the normal already defined in N0<br>
&gt;<br>
&gt; - Bump Nodes in the user interface will compute the bump normal using the<br>
&gt; ShaderData::N as base normal already defined by N0 and N1, the bump normal<br>
&gt; output can be connected to normal input bsdf sockets, this normals will be<br>
&gt; writen to ClosureData::N and used latter on in the bxdf sampling functions.<br>
&gt;<br>
&gt; - For the user be able mix normals a new &quot;mix normals&quot; node could be added,<br>
&gt; is not clear if it should be a new node or upgrade the vector math node<br>
&gt; adding that option and a mix input socket.<br>
&gt;<br>
&gt; - Image node:  still needs to let the user specify the normal<br>
&gt; space whether is world/object/tangent space. Also a control &quot;intensity&quot;<br>
&gt; could be added to attenuate the normal before output it in the normal out<br>
&gt; socket?<br>
&gt;<br>
&gt; *) Internal implementation details:<br>
&gt;<br>
&gt; Bump node no longer writes directly the ShaderData::N, instead they output<br>
&gt; the normal generated. To set the normal to ShaderData::N, there is a new<br>
&gt; small node &quot;SetNormal&quot; this will be only used once in the shader graph, and<br>
&gt; right now is used to set the normal defined by the subgraph in the input<br>
&gt; normal of the output node.<br>
&gt;<br>
&gt; Obviously you have something to say here. I&#39;ll wait for your advice on this<br>
&gt; whether improve it or reimplement it in an other way.<br>
&gt;<br>
&gt; Thank you for you attention.<br>
&gt; Agus,<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Bf-cycles mailing list<br>
&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;<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><br></div>