diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-06-03 11:26:58 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-06-03 10:24:32 +0000 |
commit | 446661a199563b13db56aeddb7eeecf7259786d8 (patch) | |
tree | 88007ab9b4e6f9c58f188d6992266998cf98f42c /examples/quick/scenegraph/rendernode/shader.hlsl | |
parent | 0e767eaa29ea0a7edb101ba87fb8367e9f056eed (diff) |
Enhance rendernode example with opacity support
The opacity is already animated in the QML scene but enabling
blending and using inheritedOpacity() was not done. Until now.
Change-Id: Iaaf50c20302e29db85c5dfaeaab4d069cb18714e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/rendernode/shader.hlsl')
-rw-r--r-- | examples/quick/scenegraph/rendernode/shader.hlsl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/quick/scenegraph/rendernode/shader.hlsl b/examples/quick/scenegraph/rendernode/shader.hlsl index 8b9b9ff9d8..f300fe7aa5 100644 --- a/examples/quick/scenegraph/rendernode/shader.hlsl +++ b/examples/quick/scenegraph/rendernode/shader.hlsl @@ -2,15 +2,16 @@ cbuffer ConstantBuffer : register(b0) { float4x4 modelview; float4x4 projection; + float opacity; }; struct PSInput { float4 position : SV_POSITION; - float4 color : COLOR; + float3 color : COLOR; }; -PSInput VS_Simple(float4 position : POSITION, float4 color : COLOR) +PSInput VS_Simple(float4 position : POSITION, float3 color : COLOR) { PSInput result; @@ -23,5 +24,5 @@ PSInput VS_Simple(float4 position : POSITION, float4 color : COLOR) float4 PS_Simple(PSInput input) : SV_TARGET { - return input.color; + return float4(input.color, 1.0) * opacity; } |