I mean get them to use love.graphcs.isSupported() then if it fails use ImageData otherwise, canvasesNixola wrote:Mickeyjm, that's exactly what I want to avoid. Canvas are fast and useful, it's not fair that some Windows users can't have them because Microsoft is dumb.
3D Planets
Re: 3D Planets
Your screen is very zoomed in...
Re: 3D Planets
I get 150-180 FPS on my quad core i5 (3,2 GHz) Ubuntu setup.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: 3D Planets
Appreciate where you're coming from.mickeyjm wrote:I mean get them to use love.graphcs.isSupported() then if it fails use ImageData otherwise, canvasesNixola wrote:Mickeyjm, that's exactly what I want to avoid. Canvas are fast and useful, it's not fair that some Windows users can't have them because Microsoft is dumb.
Still fighting my way through ImageData.
Can't figure out how to direct drawing primitives to an image without using canvases.
We don't seem to have an equivalent for:
love.grahpics.setCanvas( canvas ) - something like love.graphics.setImage( image )
Guess that would essentially involve a canvas anyway.
But, if you are only dealing with pre-drawn (loaded from disk) images, you can get along pretty well.
Still looking for pointers (help) and examples - just to see how other people do it.
Conversions between userdata, imagedata & images are still a pain.
For those that are interested this is all the farther I've managed to get:
(note: I haven't found a way to convert an image to imagedata - just have to load an image as imagedata.)
Code: Select all
gr = love.graphics
-- load a host image
host = love.image.newImageData( 'buda.png' )
-- apply an effect to host image
host:mapPixel( effect )
-- load image to be inserted into host
insert = love.image.newImageData( 'Linux.png' )
-- insert imagedata into host
host:paste(insert,10,10,0,0,40,40)
-- create a drawing surface (canvas)
canvas = love.graphics.newCanvas( 20,20)
-- direct drawing to canvas
gr.setCanvas( canvas )
gr.setColor(255,55,255,255)
gr.circle('fill',10,10,8)
gr.setCanvas()
-- convert userdata (canvas) to imagedata
data = canvas:getImageData( )
-- add converted canvas to host imagedata
host:paste(data,30,30,0,0,20,20)
-- convert imagedata into an image
composite = gr.newImage(host)
-- now ready to draw composite
gr.setColorMode('replace')
gr.draw(composite,100,100)
Edit:
You can also put a image into a canvas:
Code: Select all
canvas:renderTo( function() gr.draw( image ) end )
Re: 3D Planets
that's the thing... you can't. not unless you actually find/implement a software implementation of opengl. doing this with on a pixel-by-pixel basis through lua (if mapPixel and setPixel are involved) is going to be obscenely slow for just about any task you'd actually want to use canvases for anyway.Ref wrote:Can't figure out how to direct drawing primitives to an image without using canvases.
it may be possible to get some sort of canvas emulation with some horrific hodge-podge of scissoring, off-screen drawing, and cutting those areas out of screenshots (maybe, i've never used screenshots so i don't know if they always use the actual screen area or the scissor box)
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Re: 3D Planets
OK, so my real goal with this was to make a Pandemic clone. http://www.crazymonkeygames.com/Pandemic-2.html
You can mouse over countries and it'll tell you what they are. However, I need to use a shader to get it to function properly.
I need to send the GPU a black and white image, which is a different color for each country, and a table of how red each country is. Lets say the color of a pixel in the image I send is 0x30. That's the united states. Say the US is 50% infected. It should be turned 50% red.
How can I send a texture to a shader, and how can I get the color of a random pixel on the screen? Or do I have to send it a canvas of the entire rendered screen as a texture?
You can mouse over countries and it'll tell you what they are. However, I need to use a shader to get it to function properly.
I need to send the GPU a black and white image, which is a different color for each country, and a table of how red each country is. Lets say the color of a pixel in the image I send is 0x30. That's the united states. Say the US is 50% infected. It should be turned 50% red.
How can I send a texture to a shader, and how can I get the color of a random pixel on the screen? Or do I have to send it a canvas of the entire rendered screen as a texture?
- ishkabible
- Party member
- Posts: 241
- Joined: Sat Oct 23, 2010 7:34 pm
- Location: Kansas USA
Re: 3D Planets
hold on...did I see pluto at the end there? I that the guys with degrees already went over this
Re: 3D Planets
Planet looks great. I'm really surprised that the details are made
Who is online
Users browsing this forum: No registered users and 7 guests