justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

Stencils #51

Closed justingardner closed 1 year ago

justingardner commented 2 years ago

Stencils need to be implemented - and test program mglTestStencil should work

benjamin-heasly commented 2 years ago

I started looking into this. So far, it looks like Metal directly supports stencils that are similar to OpenGL, with a similar API and set of concepts.

I'm still unclear if we need to manage our own textures to act as the stencil write targets. We did need to manage our own texture for the depth test -- so probably also for other stencils...

benjamin-heasly commented 2 years ago

I believe stencils are good to go now, with b4bff5961559ba3820ddc5491358961b768708fa.

mglTestStencil looked good as far as I can tell, a nice red and green "BBC rotating earth logo", if that makes sense.

I also added a new test mglTestMetalStencil that captures my understanding of how stencils should work and interact.

justingardner commented 2 years ago

Great! Looks like it is working as expected. I will close out.

justingardner commented 2 years ago

Actually, sorry, but when I got the computer to run mgl by opening up gatekeeper it crashes on mglTestStencil. Maybe a binary compatibility issue? Can you login and check? The computer name is balvenie...

justingardner commented 1 year ago

This is duplicated with the other issue, and no longer crashes. So will close