mellinoe / veldrid-samples

Sample projects for Veldrid
https://mellinoe.github.io/veldrid-docs/
121 stars 49 forks source link

Vulkan backend black screen #10

Closed rmalca closed 4 years ago

rmalca commented 5 years ago

In the sample "GettingStarted" when I change _graphicsDevice = VeldridStartup.CreateGraphicsDevice(window); for this _graphicsDevice = VeldridStartup.CreateGraphicsDevice(window, GraphicsBackend.Vulkan); I get a black screen without any warnings.

Any idea what it could be? Vulkan SDK Cube works fine.

mellinoe commented 5 years ago

The vertex data provided in that sample is "upside down" in Vulkan by default, unless an optional setting is enabled. This should work:

GraphicsDeviceOptions options = new GraphicsDeviceOptions() { PreferStandardClipSpaceYDirection = true };
_graphicsDevice = VeldridStartup.CreateGraphicsDevice(window, options, GraphicsBackend.Vulkan);
rmalca commented 5 years ago

The vertex data provided in that sample is "upside down" in Vulkan by default, unless an optional setting is enabled. This should work:

GraphicsDeviceOptions options = new GraphicsDeviceOptions() { PreferStandardClipSpaceYDirection = true };
_graphicsDevice = VeldridStartup.CreateGraphicsDevice(window, options, GraphicsBackend.Vulkan);

Perfect, it works now. Thanks!