<div dir="ltr">Hello, Mr. Howard,<div><br>I have implemented the color lock and the alpha blend, have a look at it I have pushed the code.</div><div><br></div><div>I am now planning to work on bake color. What do you think?</div><div><br></div><div>Thank you.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 20, 2017 at 6:15 PM, Howard Trickey <span dir="ltr">&lt;<a href="mailto:howard.trickey@gmail.com" target="_blank">howard.trickey@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 dir="ltr">Hi Darshan,<div><br></div><div>Your plan to next work blending alpha according to mode, and locking color, seems good to me.</div><div><br></div><div>Somehow I don&#39;t think depth ordering is the issue with the transparent display.  We&#39;ll have to leave this as a background task to fix while moving on to other things now.  This is only meant at the moment as a kind of quick hack so the user can see some effect of changing alpha in Vertex Paint mode, and that much is accomplished.</div><div><br></div><div>The concept of padding is that each C data type takes a certain number of bytes and is (by default, and by most compilers) aligned on certain &quot;address boundaries&quot; because machines access them better that way. On typical machines today:</div><div>char, bool - take 1 byte, can go at any address</div><div>short - takes 2 bytes, goes on even addresses</div><div>int, long, float, pointer - take 4 bytes, go on multiple-of-4 addresses</div><div>double - takes 8 bytes, goes on multiple-of-8 addresses</div><div><br></div><div>So when you declare a struct, it puts them in order but if the next address available would not fit the above rules, internal padding (basically, unused bytes) is inserted in order to make the required alignment. For more information, read, say <a href="https://en.wikipedia.org/wiki/Data_structure_alignment" target="_blank">https://en.wikipedia.org/<wbr>wiki/Data_structure_alignment</a></div><div><br></div><div>With some structs in Blender that are to be persisted to disk, we want the total length of the struct to have size that is a multiple of 8. If by following the above rules, you end up with a struct that is not a multiple of 8, you may have to add declaration of some chars and possibly an int in order to end up with a multiple of 8. Also, it seems that we explicitly put in pad declarations rather than relying on the compiler to do it for &#39;jumps&#39; caused by alignment concerns. I guess this is to make it easy for a program to do size calculations when looking at the struct defs in the makesdna directory.  E.g., see the ID and PreviewImage struct defs in makesdna/DNA_ID.h for both types of pads.</div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 20, 2017 at 6:07 AM Darshan  kadu &lt;<a href="mailto:darsh7807@gmail.com" target="_blank">darsh7807@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, Mr. Howard,<div><br></div><div>Yes, I also think that the alpha should be blend similar to rgb. It will be simple to implement. </div><div><br></div><div>About the channel lock, the artists want it, so having it would be good think, I can do it with r,g,b bool in the brush struct and changing them from  UI,  Can you tell me the concept of padding you mention before for adding element in the structure. </div><div><br></div><div>For visualization section, Can cull face be useful? but for the cases like plane the back view will not be displayed. </div><div><br></div><div>Another thing that can be done is drawing according the depth the most depth faces first, I haven&#39;t done it before). This blog explains this very well <a href="https://learnopengl.com/#!Advanced-OpenGL/Blending" target="_blank">https://learnopengl.com/#<wbr>!Advanced-OpenGL/Blending</a>.</div><div><br></div><div>But again why only some faces are behaving like that, why not all? This is something interesting!</div><div><br></div><div>Now, I will be adding the alpha blending similar to rgb, and locking color. </div><div><br></div><div>Thank you.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 19, 2017 at 7:39 PM, Darshan  kadu <span dir="ltr">&lt;<a href="mailto:darsh7807@gmail.com" target="_blank">darsh7807@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 dir="auto">Hello, Mr. Howard, <div dir="auto">Sorry, I was ill from yesterday afternoon. I should haven&#39;t told you before but internet wasn&#39;t very good its monsoon season(heàvy rain) in India. </div><div dir="auto"><br></div><div dir="auto">Meanwhile, yesterday I changed the ply importer to take alpha into account. I have pushed the code. I thing the same problem comes with the fbx importer. I will check it. I will give reply to your mail as soon as possible.</div><div dir="auto"><br></div><div dir="auto">Sorry, I should have told you yesterday itself.</div><div dir="auto"><br></div><div dir="auto">Thank you.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On 19-Jul-2017 6:40 PM, &quot;Howard Trickey&quot; &lt;<a href="mailto:howard.trickey@gmail.com" target="_blank">howard.trickey@gmail.com</a>&gt; wrote:<br type="attribution"></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr">Darshan,<div><br></div><div>What are you working on now?</div><div><br></div><div>I looked a little more at the issue of alpha display after subdividing. I am pretty sure now that the alphas are set properly -- if you remove all but, say, the front (subdivided) face, the display looks OK. I tried changing the glBlendfunc call to:</div><div><div><span style="white-space:pre-wrap">                </span>glBlendFuncSeparate(GL_SRC_<wbr>ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);</div></div><div>which seems more correct, but it didn&#39;t make any difference.</div><div><br></div><div>Maybe someone reading this with more experience with OpenGL and alpha-blending has an idea?  I wonder if somehow we have to turn on drawing the elements in proper z-sorted order?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 18, 2017 at 9:48 AM Howard Trickey &lt;<a href="mailto:howard.trickey@gmail.com" target="_blank">howard.trickey@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Darshan,<div><br></div><div>I made a little python function to dump the vertex (loop) colors on the console.  You may find this useful.  If you put this in, say, the release/scripts/startup folder then you can use the &lt;Space&gt;-menu to search for &#39;Dump Vertex Colors&#39;.  To see which faces and vertices correspond to which dumped colors, you can start blender with --debug and then enable the &#39;indices&#39; visualization box in the right-hand panel of view3d (when in Edit mode) to see the indices of the currently selected elements.</div><div><br></div><div>I think there may be a problem with the ply exporter, discovered by using this. I made a simple plane quad and put different colors and alphas on each, and then the ply exporter seemed to have an off-by-one error in lining up colors with vertices. But I looked briefly at the code and didn&#39;t see what was wrong.</div><div><br></div><div>I also checked the interpolation of alpha&#39;s when subdividing and agree with you that it seems to be doing approximately the right thing, so the problem is somehow in the visualization code.</div></div></blockquote></div>
<br></span><span>______________________________<wbr>_________________<br>
Soc-2017-dev mailing list<br>
<a href="mailto:Soc-2017-dev@blender.org" target="_blank">Soc-2017-dev@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/soc-2017-dev" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/soc-2017-dev</a><br>
<br></span></blockquote></div></div>
</blockquote></div><br></div>
______________________________<wbr>_________________<br>
Soc-2017-dev mailing list<br>
<a href="mailto:Soc-2017-dev@blender.org" target="_blank">Soc-2017-dev@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/soc-2017-dev" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/soc-2017-dev</a><br>
</blockquote></div>
</div></div><br>______________________________<wbr>_________________<br>
Soc-2017-dev mailing list<br>
<a href="mailto:Soc-2017-dev@blender.org">Soc-2017-dev@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/soc-2017-dev" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/soc-2017-dev</a><br>
<br></blockquote></div><br></div>