using opengl for effects on a 2d game...
Greetings,
i almost finished a little 2d puzzle game for LINUX and windows. Now that i am waiting for the last pictures, i thought i could add some nice looking opengl effects.
I thought about water/wave or plasma effects, drawn over the playground/splash screen. The problem is that i have no idea where to start. I have a copy of the red book, but i am in need of some more specific information.
Please post a reply if you have some usefull information or if know a good tutorial.
Thanks in advance,
Mike
Hell ain''t a bad place, hell is from here to eternity!
Greetings again,
is it raaly a that strange idea to use opengl just as an enhancement for a 2d game?
I just ask because i was''nt able to find any useful tutorials/demos....
is it raaly a that strange idea to use opengl just as an enhancement for a 2d game?
I just ask because i was''nt able to find any useful tutorials/demos....
Hell ain''t a bad place, hell is from here to eternity!
how did you have done it till now?
using sdl? then it should be not that big problem. nehe has one tutorial about drawing 2d-stuff, where he shows you a complete game in 2d. you can use this as a simple base to learn coding in opengl. good luck, have fun
using sdl? then it should be not that big problem. nehe has one tutorial about drawing 2d-stuff, where he shows you a complete game in 2d. you can use this as a simple base to learn coding in opengl. good luck, have fun
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
Hi again,
yes i worte the linux version with sdl.
The problem with the water effect is that i am short on cpu time, so i thougt using opengl for the water effect would not be that calculation intensive as computing the water effect through the cpu. But i am uncertain in this assumtion...
Unfortunatly i was not able to find an opengl water demo...
yes i worte the linux version with sdl.
The problem with the water effect is that i am short on cpu time, so i thougt using opengl for the water effect would not be that calculation intensive as computing the water effect through the cpu. But i am uncertain in this assumtion...
Unfortunatly i was not able to find an opengl water demo...
Hell ain''t a bad place, hell is from here to eternity!
Hi again,
yes i worte the linux version with sdl.
The problem with the water effect is that i am short on cpu time, so i thougt using opengl for the water effect would not be that calculation intensive as computing the water effect through the cpu. But i am uncertain in this assumtion...
Unfortunatly i was not able to find an opengl water demo...
yes i worte the linux version with sdl.
The problem with the water effect is that i am short on cpu time, so i thougt using opengl for the water effect would not be that calculation intensive as computing the water effect through the cpu. But i am uncertain in this assumtion...
Unfortunatly i was not able to find an opengl water demo...
Hell ain''t a bad place, hell is from here to eternity!
please give more details about the effect you want.
1- when do you want it to appear ?
often or not ?
2- where do you want it ?
in the menus ? in the game ?
more likely in the center of the screen ? in a corner ?
faded in background ? on top of every drawing ?
3- which size so you want it to have ?
a little effect for some puzzle pads ? an effect that fulfills the entire screen (eg to fade between a screen and another) ?
The answers of this questions, and maybe other questions too, will help us what effect to propose. a big quality effect or not, a cpu-intensive effect or not, etc.
1- when do you want it to appear ?
often or not ?
2- where do you want it ?
in the menus ? in the game ?
more likely in the center of the screen ? in a corner ?
faded in background ? on top of every drawing ?
3- which size so you want it to have ?
a little effect for some puzzle pads ? an effect that fulfills the entire screen (eg to fade between a screen and another) ?
The answers of this questions, and maybe other questions too, will help us what effect to propose. a big quality effect or not, a cpu-intensive effect or not, etc.
Hello Vincoof,
thank''s for your reply! I commented your qestions below.
The main problem is that the effect should use as less cpu time as possible but also should look as good as possible.
To be honest i thougt i could use some opengl features that leads to a water effect instead of calculating it on the cpu.
Thank''s for your help,
Mike
1- when do you want it to appear ? - in the game
often or not ? - i thougt about one water frame for every second displayed frame
2- where do you want it ? - on one of the source surfaces
more likely in the center of the screen ? 80% to 100% of the surface
in a corner ? - full surface would be nice
faded in background ? - would be nice, but doesn''t matter
on top of every drawing ? - just on top of one of the surfaces
3- which size so you want it to have ? 640x460 (480 is fine too)
an effect that fulfills the entire screen (eg to fade between a screen and another) ? should only be drawn over one of the source surfaces
thank''s for your reply! I commented your qestions below.
The main problem is that the effect should use as less cpu time as possible but also should look as good as possible.
To be honest i thougt i could use some opengl features that leads to a water effect instead of calculating it on the cpu.
Thank''s for your help,
Mike
1- when do you want it to appear ? - in the game
often or not ? - i thougt about one water frame for every second displayed frame
2- where do you want it ? - on one of the source surfaces
more likely in the center of the screen ? 80% to 100% of the surface
in a corner ? - full surface would be nice

faded in background ? - would be nice, but doesn''t matter
on top of every drawing ? - just on top of one of the surfaces
3- which size so you want it to have ? 640x460 (480 is fine too)
an effect that fulfills the entire screen (eg to fade between a screen and another) ? should only be drawn over one of the source surfaces
Hell ain''t a bad place, hell is from here to eternity!
Correct me if I''m wrong, but you''d like to have an effect water over the puzzle, where the objects start to fall :
(if the puzzle game is a tetris-like)
The dash lines would be the border of the puzzle, and the stars would be where the water lies.
If no, could you please a post a representation (either horrible text or beatiful image) of what the puzzle *roughly* look like and where you would like to draw the "source surface" ?
(if the puzzle game is a tetris-like)
| ||**********|| || || || || | ----------
The dash lines would be the border of the puzzle, and the stars would be where the water lies.
If no, could you please a post a representation (either horrible text or beatiful image) of what the puzzle *roughly* look like and where you would like to draw the "source surface" ?
immagine minesweeper with a grayscale background pickture on the part of the playground that is not jet opened/discovered. The hiden surface is the one i like to animate with a water effect.
So at the beginning the entire screen would look like grayscale water. As soon as a sqare of the puzzle is solved the sqare of the grayscale source surface will be replaced with a sqare from a colored surface.
Here''s a littel graphic to illustrate hwo it should look:
********************
********************
*****XXXXXXXXX******
*****XXXXXXXXX******
*****XXXXXXXXX******
*****XXXXXXXXX******
********************
********************
X are discoverd, colored sqares (no water)
* are grayscale, hiden sqares (that should look like there''s some water over the picture)
Vincoof, thank''s for your interest and please dont get me wrong, but i would like to write the water effect myself. (I am currently short on cpu time so i have to do it in assembly language). Some code that illustrates how do programm a water effect would be nice, but i would prefer a tutorial/explanation about how to do it.
I also would share the code if anybody is interested, but i first need some information about how to write it.
However,
thanks so far,
Mike
So at the beginning the entire screen would look like grayscale water. As soon as a sqare of the puzzle is solved the sqare of the grayscale source surface will be replaced with a sqare from a colored surface.
Here''s a littel graphic to illustrate hwo it should look:
********************
********************
*****XXXXXXXXX******
*****XXXXXXXXX******
*****XXXXXXXXX******
*****XXXXXXXXX******
********************
********************
X are discoverd, colored sqares (no water)
* are grayscale, hiden sqares (that should look like there''s some water over the picture)
Vincoof, thank''s for your interest and please dont get me wrong, but i would like to write the water effect myself. (I am currently short on cpu time so i have to do it in assembly language). Some code that illustrates how do programm a water effect would be nice, but i would prefer a tutorial/explanation about how to do it.
I also would share the code if anybody is interested, but i first need some information about how to write it.
However,
thanks so far,
Mike
Hell ain''t a bad place, hell is from here to eternity!
Hmm. I think the most simple, the most efficient and also the most realistic method would be to build a giant quadstrip and animate the water by moving the quad corners "randomly" into the Z axis.
This way it would not cost a lot of cpu (you can optimize the moving water because calling rand() for each corner would cost too much) and it would be very easy to "dig" the water as the puzzle evolves.
Do you see what I mean ?
If yes, what do you think of it ?
This way it would not cost a lot of cpu (you can optimize the moving water because calling rand() for each corner would cost too much) and it would be very easy to "dig" the water as the puzzle evolves.
Do you see what I mean ?
If yes, what do you think of it ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement