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

Load file to texture & apply transformations with stacked shaders #35

Open
fenollp opened this issue Apr 11, 2017 · 3 comments
Open

Load file to texture & apply transformations with stacked shaders #35

fenollp opened this issue Apr 11, 2017 · 3 comments

Comments

@fenollp
Copy link
Collaborator

fenollp commented Apr 11, 2017

The time it takes to transmit data to GPU is non negligible.

Right now what we do is

  1. mmap the file to RAM
  2. create RAM buffers for vertices & colors & the indices of the elements that are worth rendering
  3. transfer these buffers to GPU memory
  4. draw
  5. repeat

Instead we could

  1. load the file into a texture (mmap on GPU?)
  2. create vertices & their colors with shaders (tricky part*)
  3. draw
  4. repeat

This would make the host code much simpler.
Thus porting to Web or Android would be much simpler.

*The tricky part is that to do something like Algo3DCubeFrebet with shaders, one needs to somehow:

  1. read multiple bytes from the file-texture
  2. write a color to the output texture but at different coordinates
    I believe that (x1,y1) --> (x2,y2,z) transformation is hard for a GPU.
    Maybe compute shaders can help here?

@icehess Ideas?

@fenollp
Copy link
Collaborator Author

fenollp commented Apr 18, 2020

@fenollp
Copy link
Collaborator Author

fenollp commented Apr 18, 2020

@fenollp
Copy link
Collaborator Author

fenollp commented Apr 18, 2020

Some experiments at

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, fW, fH, 0, GL_BGR, GL_UNSIGNED_BYTE,

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

1 participant