mellinoe / veldrid-samples

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

[OpenGL+METAL] Implemented Uniforms Buffer + Geometry Instancing Example #1

Closed geoeo closed 6 years ago

geoeo commented 6 years ago

I implemented a simple uniform buffer + geometry instancing example following the getting started tutorial. As of now only opengl shaders, I plan to add Metal ones soon.

As I am on a mac, DirectX and Vulkan will not be possible. Sorry

Best, Marc

mellinoe commented 6 years ago

@geoeo Hey, I'm really sorry that I ignored this. Somehow I accidentally disabled notifications for this repository and never saw your submission. I will take a look at this as soon as possible.

geoeo commented 6 years ago

No worries :)

geoeo commented 6 years ago

Thanks for the feedback. Ill implement them in the coming week.

geoeo commented 6 years ago

Theres an issue in SampleApplication.cs

GraphicsDeviceOptions options = new GraphicsDeviceOptions(false, PixelFormat.R16_UNorm, true);

The depth is a problem for my example. I can set/not set it with a flag, but then I would have to edit all the other examples as well. I dont mind doing that, but its your call.

mellinoe commented 6 years ago

@geoeo Why is the depth a problem? You should need a depth buffer for this, and that is what creates it. We can make it configurable, though, if it's really necessary.

geoeo commented 6 years ago

When I initialise the depth option to something that is not null the get a black screen. Probably because it expects a depth buffer which I haven't created

mellinoe commented 6 years ago

@geoeo Are you clearing the depth buffer? If not, it's probably sitting at 0 and thus all your depth tests are failing.

geoeo commented 6 years ago

haha. This never happened.

geoeo commented 6 years ago

Do you want me to remove the struct form the uniform? Its better less syntax noise.

All requests should be impemented

mellinoe commented 6 years ago

Hey @geoeo , I squashed this down and merged it along with a couple of my own (for cleanup and for implementing D3D11/Vulkan).

See:

https://github.com/mellinoe/veldrid-samples/commit/88798d57ff7186b94c2fbc85b8a0b81f7cdb55a4 https://github.com/mellinoe/veldrid-samples/commit/ac401c4301e7b51956f858564417d9e84e71fc26 https://github.com/mellinoe/veldrid-samples/commit/a764fa767445ddc83226be479027cf3b64a705f9