More possibilities for image rendering :P

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

More possibilities for image rendering :P

Post by Borsty »

Hi, I'm working on a little game ( won't tell you what it is now, I'm still working on some kind of engine for it ) and I'm missing more advanced possibilities to use images.
As you're using openGL would it be too much to ask for some kind of U/V mapping and / or vertex coloring possibilities? :D
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: More possibilities for image rendering :P

Post by rude »

Major enhancements to love.graphics in general are planned, but specifics depend om community input, so feature requests can only be a good thing.

There is usually a tradeoff between flexibility and performance, especially when dealing with data transfers between Lua and C. I assume we should take the stateful approach in this case, in order to not kill performance entirely.

How would you want the code to look like (for UV mapping, vertex coloring, etc)?
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: More possibilities for image rendering :P

Post by Borsty »

Maybe something like

Code: Select all

love.graphics.rawtriangle( style, image, pointA, pointB, pointC )
and point* parameters could be tables with X, Y, U, V, R, G, B and A values
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: More possibilities for image rendering :P

Post by rude »

Yeah, that would be flexible, but not very fast. If we want speed, we would also need something like:

Code: Select all

img = love.graphics.newImage("textures/tex.png")

-- These buffers represent C arrays.
vex = love.graphics.newVertexBuffer( table )
tex = love.graphics.newTexelBuffer( table )
clr = love.graphics.newColorBuffer( table )

-- Change some values:
clr[0] = 255
clr[1] = 0
vex[0] = 255

love.graphics.drawb( love.draw_triangles, vex, tex, clr, img, start, end)
Vex, tex and clr can either be native buffers or Lua tables. The former being fast, the latter being flexible.
Post Reply

Who is online

Users browsing this forum: rabbitboots and 231 guests