[Interest] [Qt3D] Diffusemap alpha

Oleg Evseev ev.mipt at gmail.com
Mon Jan 9 21:51:02 CET 2017


I was wondered why Qt3D diffusemap material doesn't implement texture alpha
for fragColor or why there no diffuseMapAlpha material at least.

I tried to modify diffusemap.frag by analogy with

set diffuseTextureColor as vec4 and make
fragColor = vec4( diffuseTextureColor.rgb * ( ka + diffuseColor ) + ks *
specularColor, diffuseTextureColor.a );

Alpha works, but there is ambient color that mess the transparency effect I

I tried without ka component but got transparent black color.
But at least in this case zero texture alpha make fully transparent.

Then I encountered on unlittexture.frag and TextureMaterial.qml that use it
(by the way why there is no corresponding QTextureMaterial?) that just set
diffuseTextureColor to fragColor:

fragColor = texture( diffuseTexture, texCoord );

But I got effect like there is white ambient summed with transparent
texture color.
With zero texture alpha I've got white non transparent object.

I'm new in shaders, I'm confused with such behavior.

Thanks in advance for any explanations!


Regards, Oleg.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170109/e465309a/attachment.html>

More information about the Interest mailing list