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

Sampling without saving to file #6

Open
PerryXDeng opened this issue Aug 20, 2022 · 1 comment
Open

Sampling without saving to file #6

PerryXDeng opened this issue Aug 20, 2022 · 1 comment

Comments

@PerryXDeng
Copy link

PerryXDeng commented Aug 20, 2022

Is there potentially a way to directly query the SDFs defined in the shader programs with Python instead of having to sample them into files on disk first? This can dramatically decrease the amount of I/O operations and speed things up a bit for some sampling implementations. I have looked into various OpenGL wrappers for Python, including PyOpenGL, all of which don't seem to support calling specific functions (eg. float sdf(vec3 p)) other than void main() from a shader program.

Thanks for your work and looking forward to any advice.

@tovacinni
Copy link
Owner

Hi Perry,

Thanks for your interest in our library. You could consider using Glumpy, which allows you to use OpenGL and invoke custom shaders to write to a numpy array. You would just need to pass in some sort of input as a buffer (or make it procedural) and write a main that invokes the SDF.

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