Page 1 of 1

GLSL: buffering pixel data (non-linear frag shader)

Posted: Sat Nov 21, 2015 6:57 pm
by Mystical
I've recently been writing a raycaster, it's currently functioning and displaying everything properly, but my main issue here is optimization.

Since I don't know how to buffer data to push on later to the frag shader, I cast rays for each pixel of the game's resolution, making what could be a 2D, heightmap-based raycaster a full-blown 3D one. This isn't very optimal, since the only thing I needed was to cast rays through the screen width, not the screen width by height.

I'd really appreciate if someone could help me with this, I've been looking everywhere in OpenGL's documentation, but so far, most of the stuff doesn't work, not even the arrays.

Re: GLSL: buffering pixel data (non-linear frag shader)

Posted: Sun Nov 22, 2015 12:21 am
by s-ol
I have no idea what specific requirements you have for a raycaster, but if you need to push or work on a lot of data, you can put it into a drawable like a Canvas.