Example: effective rendering

Show off your games, demos and other (playable) creations.
User avatar
sauer2
Citizen
Posts: 61
Joined: Tue Sep 02, 2008 4:15 pm

Example: effective rendering

Post by sauer2 »

A small arcade game, which only renders blocks that are in the visual area to save performance.
Attachments
spacemaze.love
(389.47 KiB) Downloaded 378 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Example: effective rendering

Post by Robin »

Fun game, although it's quite hard. I don't know about you, but it is virtually impossible for me to get around that second obstacle (the one where you have to go back).
EDIT: OK, I passed the level. Apparently I just needed some practice :ehem:. It was fun and challenging, and the graphics, especially the background, are lovely.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Example: effective rendering

Post by bartbes »

Again, is the setScissor function hidden or something? Because it appears you're trying to do the same thing as setScissor. (which might be more efficient)

The game is fun though.

@Robin: and I think the 3rd is harder than the 2nd, I passed the 2nd after 2 or 3 tries. (not every time though)
User avatar
sauer2
Citizen
Posts: 61
Joined: Tue Sep 02, 2008 4:15 pm

Re: Example: effective rendering

Post by sauer2 »

I guess it comes to if scissors is implemented in Lua or is an SDL-Binding.
If it's Löve specific, it uses more statements than my solution, because it is more general, hence it's slower.
But if it's a Binding to a SDL function scissor or written in C, it's faster.

Maybe some wih a weak computer wants to compare them?
I can run this fluid even without any rendering limitation.
Attachments
spacemaze_scissor.love
(389.48 KiB) Downloaded 259 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Example: effective rendering

Post by Robin »

Scissors actually seems to come from OpenGL, which would make it faster than Lua.

love_opengl.cpp:

Code: Select all

	void setScissor(int x, int y, int width, int height)
	{
		glEnable(GL_SCISSOR_TEST);
		glScissor(x, getHeight() - (y + height), width, height);
	}
@bartbes: odd, as the rest of the level (including the 3rd obstacle) is relatively easy to me.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Example: effective rendering

Post by bartbes »

So.. sorry sauer2, the game is great, but the scissoring is already done.

@Robin: maybe that's because I play too wild, I get the object flying after my pointer, instead of on top of.
User avatar
sauer2
Citizen
Posts: 61
Joined: Tue Sep 02, 2008 4:15 pm

Re: Example: effective rendering

Post by sauer2 »

bartbes wrote:So.. sorry sauer2, the game is great, but the scissoring is already done.
Ok.
I think, it would be interesting to have the possibility to have several scissor areas and to limit them for some graphics.
Is something like this planned?
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Example: effective rendering

Post by qubodup »

You can measure it by printing the fps every second I guess.

pretty good looking, good-feeling game :) even though I'm a sworn enemy to the 1mistake-and-u-die genre (as you already know ;) )
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Xcmd
Party member
Posts: 211
Joined: Fri Feb 13, 2009 10:45 pm

Re: Example: effective rendering

Post by Xcmd »

The version that uses Scissor is actually a lot faster for me, especially in the movement of the ball. Almost unplayably fast, actually. My machine isn't terribly throttled, but I'm running under Linux, Ubuntu 9.04. I've got a 256 MB graphics card, 4GB of RAM and a quad-core 1.x gHz (can't remember the speed right now) AMD Phenom. So, y'know. It's not slow. But the difference between the two is noticeable.
We don't borrow, we don't read, we don't rent, we don't lease, we take the minds!
User avatar
sauer2
Citizen
Posts: 61
Joined: Tue Sep 02, 2008 4:15 pm

Re: Example: effective rendering

Post by sauer2 »

qubodup wrote:You can measure it by printing the fps every second I guess.

pretty good looking, good-feeling game :) even though I'm a sworn enemy to the 1mistake-and-u-die genre (as you already know ;) )
... 1mistake-and-u-die.. seems a pretty good title for a iwannabetheguy like game. :ultraglee:

@Xcmd:Ok, thanks, that makes it a lot clearer to me.
Post Reply

Who is online

Users browsing this forum: No registered users and 61 guests