Using Love for 2d, one can introduce pixel shaders. These allow one to
do all kinds of color effects by coding directly to the graphics card!?
* * *
Below, the example Shaders code from the Love2d website. It's a 'Climb every
mountain' moment. The shader irself is coded in a language that is not Lua, but
OpenGl.
It is a C-family language (note the colon endings). The portion in orange below
is the stranger in the page: comments, and actual code. It is essentially telling
me that I have color code, and coordinates from a source image, coordinates of the
screen to work with to make my magic. An image - texture - in this context is
a color map!!
No comments:
Post a Comment