<html xmlns:v="urn:schemas-microsoft-com:vml" 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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [Interest] Quick3D mapping of png textures onto Item 3D</title>
<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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The example which you have sent is working only till the
animation completes.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>When I use QtQuick2.0 in the example shared without any
animation, the blending doesnot works and the total .png is black in color.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Could you please let me know how to fix this issue in QtQuick3D.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Br,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Satya<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Satya Praveen
Ganapathi <br>
<b>Sent:</b> Thursday, September 20, 2012 4:20 PM<br>
<b>To:</b> Thomas Senyk<br>
<b>Cc:</b> Ramakanthreddy_Kesireddy; interest@qt-project.org<br>
<b>Subject:</b> RE: [Interest] Quick3D mapping of png textures onto Item 3D<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<div id=idOWAReplyText78523>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Hi,</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks
for the reply.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Actually
we donot have mesh for the png files..so we need to use 3D Items
predefined(like Quad,Cylnder etc).</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I
suppose there is no inbuilt 3D rectangle item.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

<div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Can
I use 2.0 instead of 1.0 in the cube example that you shared?</span><o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>import QtQuick 1.0<br>
import Qt3D 1.0<br>
import Qt3D.Shapes 1.0<o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal> <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Regards,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Satya<o:p></o:p></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Thomas Senyk
[mailto:thomas.senyk@pelagicore.com]<br>
<b>Sent:</b> Thu 9/20/2012 2:52 PM<br>
<b>To:</b> Satya Praveen Ganapathi<br>
<b>Cc:</b> Ramakanthreddy_Kesireddy; interest@qt-project.org<br>
<b>Subject:</b> Re: [Interest] Quick3D mapping of png textures onto Item 3D</span><o:p></o:p></p>

</div>

<div>

<p><span style='font-size:10.0pt'>It's working for me.<br>
I did a fresh build from source and used an old example and it's working.<br>
I just use the qmlviewer (don't forget the -opengl argument)<br>
<br>
<br>
One important thing to know:<br>
Doing blending in a generic way for a library is a quite tricky task.<br>
To do it properly one would need to sort all surfaces by there position in the<br>
3D-space (and even that is not the end solution if you want to be perfect)<br>
which is in most cases not really necessary and would consume a lot of cpu.<br>
So I assume that's why this is not done in QtQuick3D and therefor the blending<br>
isn't "optically correct".<br>
But one should definitely see the blending! (adding a blue Rectangle as<br>
background helps "seeing it" ;) )<br>
<br>
<br>
<br>
On Thu, September 20, 2012 02:40:13 PM Satya Praveen Ganapathi wrote:<br>
> Hi,<br>
><br>
> I tried with the below code to resolve the transparent area of png shown<br>
> as black shaded:-<br>
><br>
> ViewPort<br>
> {<br>
> Width:parent.width<br>
> Height:parent.height<br>
> blending:true<br>
><br>
> Quad{<br>
> effect:Effect{<br>
> texture:"img.png"<br>
> }<br>
> }<br>
><br>
> However, it still shows the transparent area of png file as black<br>
> shaded.<br>
><br>
> Please let me know the solution or this is a known issue in Quick3D.<br>
><br>
> Best Regards,<br>
> Satya<br>
><br>
> -----Original Message-----<br>
> From: interest-bounces+praveen.s=hmie.co.in@qt-project.org<br>
> [<a href="mailto:interest-bounces+praveen.s=hmie.co.in@qt-project.org">mailto:interest-bounces+praveen.s=hmie.co.in@qt-project.org</a>]
On Behalf<br>
> Of Ramakanthreddy_Kesireddy<br>
> Sent: Thursday, September 20, 2012 10:25 AM<br>
> To: Thomas Senyk; interest@qt-project.org<br>
> Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D<br>
><br>
> Hi,<br>
><br>
> We tried with below blending property in Effect but transparent area of<br>
> the png file is<br>
> still shown as black shaded.<br>
><br>
><br>
> Quad{<br>
><br>
> Effect{<br>
> texture:"img.png"<br>
> blending:true<br>
> }<br>
> }<br>
><br>
> Could you please let us know if we are mssing anything in this regard.<br>
><br>
> Br,<br>
> Ramakanth<br>
> ________________________________________<br>
> From:<br>
> interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project.<br>
> org<br>
> [interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project<br>
> .org] on behalf of Thomas Senyk [thomas.senyk@pelagicore.com]<br>
> Sent: Wednesday, September 19, 2012 5:13 PM<br>
> To: interest@qt-project.org<br>
> Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D<br>
><br>
> As he is using QtQuick3D, the answer is simpler:<br>
> <a
href="http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro">http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro</a><br>
> p<br>
><br>
> :)<br>
><br>
> Greets<br>
> Thomas<br>
><br>
> On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:<br>
> > 2012/9/18 Satya Praveen Ganapathi <praveen.s@hmie.co.in>:<br>
> > > ...<br>
> > > However, the png image is not getting displayed properly in 3D
space<br>
><br>
> i.e.<br>
><br>
> > > transparent area of the png file is<br>
> > > shown as black shaded.<br>
> ><br>
> > Most probably you simply need to enable "alpha blending":
In OpenGL<br>
> > terms that usually means<br>
> ><br>
> > a) Turn blending on: glEnable(GL_BLEND)<br>
> > b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,<br>
> > GL_ONE_MINUS_SRC_ALPHA)<br>
> ><br>
> > Note: "Premultiplied alpha" textures (refer to Wikipedia or
the Qt<br>
> > docs about the same topic) are to be preferred, in which case you<br>
> > would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)<br>
> ><br>
> > Here is a guy who is trying /exactly/ the same thing as you:<br>
> >   <a
href="http://galfar.vevb.net/imaging/smf/index.php?topic=296.0">http://galfar.vevb.net/imaging/smf/index.php?topic=296.0</a><br>
> ><br>
> > Depending on what you are trying to achieve the function glTexEnv()<br>
> > with argument GL_BLEND might be useful too (if you want to apply
alpha<br>
> > blending at the moment when applying the texture - and if you want<br>
> > that the underlying surface colour shines through). Refer to the<br>
><br>
> > (possibly outdated) FAQ:<br>
> <a
href="http://www.opengl.org/archives/resources/faq/technical/transparency.htm">http://www.opengl.org/archives/resources/faq/technical/transparency.htm</a><br>
><br>
> > How you apply all this to Qt 3D I don't know - but I'm sure there
must<br>
> > be this big "Enable blending" switch somewhere, too - refer
to the<br>
> > docs (and if not, to my little understanding you can still mix in
your<br>
> > own "raw OpenGL" code as above, no?).<br>
> ><br>
> > Cheers, Oliver<br>
> > _______________________________________________<br>
> > Interest mailing list<br>
> > Interest@qt-project.org<br>
> > <a href="http://lists.qt-project.org/mailman/listinfo/interest">http://lists.qt-project.org/mailman/listinfo/interest</a><br>
><br>
> _______________________________________________<br>
> Interest mailing list<br>
> Interest@qt-project.org<br>
> <a href="http://lists.qt-project.org/mailman/listinfo/interest">http://lists.qt-project.org/mailman/listinfo/interest</a><br>
><br>
> ________________________________<br>
><br>
> DISCLAIMER:<br>
> This email (including any attachments) is intended for the sole use of<br>
> the intended recipient/s and may contain material that is CONFIDENTIAL<br>
> AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or<br>
> copying or distribution or forwarding of any or all of the contents in<br>
> this message is STRICTLY PROHIBITED. If you are not the intended<br>
> recipient, please contact the sender by email and delete all copies;<br>
> your cooperation in this regard is appreciated.<br>
> _______________________________________________<br>
> Interest mailing list<br>
> Interest@qt-project.org<br>
> <a href="http://lists.qt-project.org/mailman/listinfo/interest">http://lists.qt-project.org/mailman/listinfo/interest</a></span>
<o:p></o:p></p>

</div>

</div>

</body>

</html>