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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Mystical
Prole
Posts: 7
Joined: Sun Mar 15, 2015 4:39 pm

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

Post 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.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

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

Post 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.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests