Jean Felder b69feb0817 qgsphongtexturedmaterialsettings: Add support for opacity
Qt3DRender::QTexture2D does not handle opacity. Therefore, it is not
possible to use the default Qt3DExtras::QDiffuseSpecularMaterial
implementation. This problem is solved by using
Qt3DRender::QMaterial and copying the
Qt3DExtras::QDiffuseSpecularMaterial shaders from Qt3D source
code. Then, the texture color needs to be changed to set the correct
opacity. This is achieved in the fragement shader:

```
vec4 diffuseTextureColor = vec4(texture(diffuseTexture, texCoord).rgb,
opacity);
```

instead of the default:

```
vec4 diffuseTextureColor = vec4(texture(diffuseTexture, texCoord));
```

As far as the FrameGraph is concerned, this is already handled in
Qgs3DMapScene::finalizeNewEntity which checks for all material which
have an effect with an opacity parameter.
2022-07-25 07:38:12 -07:00
..
2022-04-27 11:50:13 +10:00