[Interest] Quick3D mapping of png textures onto Item 3D

Ramakanthreddy_Kesireddy Ramakanthreddy_Kesireddy at mahindrasatyam.com
Thu Sep 20 06:54:32 CEST 2012


Hi,

We tried with below blending property in Effect but transparent area of the png file is
still shown as black shaded.


Quad{

Effect{
texture:"img.png"
blending:true
}
}

Could you please let us know if we are mssing anything in this regard.

Br,
Ramakanth
________________________________________
From: interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org [interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com at qt-project.org] on behalf of Thomas Senyk [thomas.senyk at pelagicore.com]
Sent: Wednesday, September 19, 2012 5:13 PM
To: interest at qt-project.org
Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

As he is using QtQuick3D, the answer is simpler:
http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-prop

:)

Greets
Thomas

On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:
> 2012/9/18 Satya Praveen Ganapathi <praveen.s at hmie.co.in>:
> > ...
> > However, the png image is not getting displayed properly in 3D space i.e.
> > transparent area of the png file is
> > shown as black shaded.
>
> Most probably you simply need to enable "alpha blending": In OpenGL
> terms that usually means
>
> a) Turn blending on: glEnable(GL_BLEND)
> b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,
> GL_ONE_MINUS_SRC_ALPHA)
>
> Note: "Premultiplied alpha" textures (refer to Wikipedia or the Qt
> docs about the same topic) are to be preferred, in which case you
> would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
>
> Here is a guy who is trying /exactly/ the same thing as you:
>
>   http://galfar.vevb.net/imaging/smf/index.php?topic=296.0
>
> Depending on what you are trying to achieve the function glTexEnv()
> with argument GL_BLEND might be useful too (if you want to apply alpha
> blending at the moment when applying the texture - and if you want
> that the underlying surface colour shines through). Refer to the
> (possibly outdated) FAQ:
>
>   http://www.opengl.org/archives/resources/faq/technical/transparency.htm
>
>
> How you apply all this to Qt 3D I don't know - but I'm sure there must
> be this big "Enable blending" switch somewhere, too - refer to the
> docs (and if not, to my little understanding you can still mix in your
> own "raw OpenGL" code as above, no?).
>
> Cheers, Oliver
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

________________________________

DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.



More information about the Interest mailing list