Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing multiple Gabor patches #1

Open
least2 opened this issue Jul 6, 2022 · 3 comments
Open

Drawing multiple Gabor patches #1

least2 opened this issue Jul 6, 2022 · 3 comments

Comments

@least2
Copy link

least2 commented Jul 6, 2022

Hi, I'm proposing a solution to lift the limitation you mentioned in the README that multiple Gabor patches could not be presented superimposed. First, the Gaussian envelope could be saved as the alpha channel so that the patch becomes semi-transparent. Second, compared to writing GLSL shaders that specifically draw multiple Gabor patches, it is much easier to draw only one patch at a time and save it as an image, then draw multiple semi-transparent patches on a regular 2D canvas or simply on the web page and they are superimposed.

I have created a Garborium-like demo (source). It uses gl.readPixels() to read back the pixel data of the Gabor and then draw it multiple times on a regular canvas.

@kurokida
Copy link
Owner

kurokida commented Jul 8, 2022

Thank you for your valuable comments and the demo program! I don't fully understand your source code yet, but at first glance it seems to work fine.

@least2
Copy link
Author

least2 commented Jul 8, 2022

I would also recommend GPU.js for creating complex visual stimuli with WebGL in the browser.

GPU.js automatically transpiles simple JavaScript functions into shader language and compiles them so they run on your GPU.

It saves you the trouble of writing GLSL shaders by hand. Here are some examples: a drifting Gabor patch and fancy gratings

@kurokida
Copy link
Owner

kurokida commented Jul 8, 2022

Thanks again! This information is beneficial not only to me but to many others.

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

No branches or pull requests

2 participants