Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Multiply blend mode doesn't work on DX11 render backend #2790

Open
gleblebedev opened this issue Mar 19, 2021 · 3 comments
Open

Multiply blend mode doesn't work on DX11 render backend #2790

gleblebedev opened this issue Mar 19, 2021 · 3 comments
Labels

Comments

@gleblebedev
Copy link
Contributor

gleblebedev commented Mar 19, 2021

Fails with the error:

image

Works fine on opengl.

Sample material:

  <material>
	  <technique name="Techniques/DiffMultiply.xml" />
	  <texture unit="diffuse" name="FPS3/Particles/Smoke/Smoke_v1/Source/Smoke_v1.dds" />
	  <parameter name="MatDiffColor" value="1 1 1 1" />
  <parameter name="MatEmissiveColor" value="0 0 0" />
	  <parameter name="UOffset" value="1 0 0 0" />
	  <parameter name="VOffset" value="0 1 0 0" />
	  <shader psdefines="PACKEDNORMAL" />
  </material>
@github-actions
Copy link

Marking this stale since there has been no activity for 30 days.
It will be closed if there is no activity for another 15 days.

@github-actions github-actions bot added the stale label Apr 19, 2021
@1vanK 1vanK added backlog and removed stale labels Apr 19, 2021
@SuperWangKai
Copy link
Contributor

SuperWangKai commented Jul 20, 2021

These are the parameters Urho uses when multiple blend mode is applied and triggers the issue-
image

By enabling the DX11 Debug Layer, we can get this error output-

D3D11 ERROR: ID3D11Device::CreateBlendState: SrcBlendAlpha[ 0 ] is trying to use a D3D11_BLEND value (0x9) that manipulates color, which is invalid. [ STATE_CREATION ERROR #215: CREATEBLENDSTATE_INVALIDSRCBLENDALPHA]

According to D3D11 Spec , it seems (Section 17.2) only these values are valid for SrcBlendAlpha -

D3D11_BLEND_ZERO
D3D11_BLEND_ONE
D3D11_BLEND_SRC_ALPHA
D3D11_BLEND_INV_SRC_ALPHA
D3D11_BLEND_DEST_ALPHA
D3D11_BLEND_INV_DEST_ALPHA
D3D11_BLEND_SRC_ALPHA_SAT
D3D11_BLEND_BLEND_FACTOR
D3D11_BLEND_INV_BLEND_FACTOR
D3D11_BLEND_SRC1_ALPHA
D3D11_BLEND_INV_SRC1_ALPHA

@PencilAmazing
Copy link
Contributor

Maybe engine should log an error saying so if blend state creation fails?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants