amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

Vortice.Direct2D1.Effects.Vignette throws Exception #418

Closed TheBarnyOfBarnim closed 9 months ago

TheBarnyOfBarnim commented 9 months ago

Setting the Color property of an Vortice.Direct2D1.Effects.Vignette throws an exception because Direct2D expects a Vector4 instead of a Vector3

Example:

var Effect = new Vortice.Direct2D1.Effects.Vignette(g.DeviceContext);

Effect.SetInput(0, MyTexture, false);

Effect.Color = new System.Numerics.Vector3(Color.R, Color.G, Color.B); //Exception, must be a Vector4

Effect.TransitionSize = 35;
Effect.Strength = 0.75f;
amerkoleci commented 9 months ago

Can you submit PR? otherwise I'll fix it Monday.

Thanka!

TheBarnyOfBarnim commented 9 months ago

Made a PR: #419

Apparently even the official Microsoft Direct2D documentation has errors:

grafik https://learn.microsoft.com/en-us/windows/win32/direct2d/vignette-effect

grafik _https://learn.microsoft.com/en-us/windows/win32/api/d2d1effects_2/ne-d2d1effects_2-d2d1_vignette_prop_