Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Posted
2004-05-22 11:54:28 » |
|
Hi there ! I've made a particle engine which work very well, except that when I draw more than one hundred particles, I get an horrible flickering effect... I've tested the code with two differents CPUs (one powered by nvidia geforce440, the other by ATI radeon 9200). That's strange because I don't get this annoying flickering effect while drawing object or full scene... I only get it when I use my particle system... How could I remove it ? I'm running Lwjgl 0.9 in fullscreen... (if you need more informations about my code, simply ask what you want to know  ) Thanks Chman Edit: forgot to say that I've tested the code with and withouth vSync... But it doesn't change anything...
|
|
|
|
|
abies
|
 |
«
Reply #1 - Posted
2004-05-22 12:14:03 » |
|
What kind of blending do you use ? Do you use different projection matrix for drawing particles ? Does entire screen flicker or only parts of screen near particles ?
|
Artur Biesiadowski
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #2 - Posted
2004-05-22 12:23:23 » |
|
First thanks for your fast answer  I use glBlendFunc(GL_SRC_ALPHA, GL_ONE); to blend the particles and the same projection matrix that I use to draw the scene (I don't change matrix at all). About the flickering, it only happen on the part of the screen where the particles are...
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Orangy Tang
|
 |
«
Reply #3 - Posted
2004-05-22 12:37:47 » |
|
Does the same thing happen without blending? Have you made sure to turn depth writes off for particles (yet leave depth testing on)? What about if you switch alpha testing instead of blending?
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #4 - Posted
2004-05-22 12:44:36 » |
|
Depth testing is off when rendering the particle... I've just tested with/without blending and/or with/without deph testing but it doesn't remove flickering...
What do you mean exactly by "alpha testing instead of blending" ? I should use glAlphaFunc ?
|
|
|
|
|
Orangy Tang
|
 |
«
Reply #5 - Posted
2004-05-22 13:04:21 » |
|
If the flickering still happens with blending off, it'll probably happen with alpha testing as well.  'Flickering' is a pretty vauge description though, how about a screenshot?
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #6 - Posted
2004-05-22 13:23:27 » |
|
I can't post a screenshot of my problem, because flickering only happen in animated mode  It's not visible on static images... I will try to make a little video shot and post the link here asap !
|
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #7 - Posted
2004-05-22 13:26:15 » |
|
Here it is : http://hourdel.chez.tiscali.fr/videoshot.zipSorry for the bad quality... This video shows my flickering problem (in reality, it's not so exagerated, it's my video generator which make more flickering  )... Don't know if it can help. Chman
|
|
|
|
|
oNyx
|
 |
«
Reply #8 - Posted
2004-05-22 14:00:31 » |
|
I have all common codecs installed (divx, xvid, 3ivx, wma[several versions], indigo and a handfull of others). However, I can't open the file and the fourCC seems to be empty?!
The codec seems to be really bad since the compression ratio is that huge. I suggest using xvid. It's free and about as good as divx.
|
|
|
|
Orangy Tang
|
 |
«
Reply #9 - Posted
2004-05-22 14:24:19 » |
|
I get a 403 error, I wonder if I have Opera configured wrongly somewhere...
|
|
|
|
Games published by our own members! Check 'em out!
|
|
ribot
Junior Member  
Ribot - mobile UI specialist
|
 |
«
Reply #10 - Posted
2004-05-22 14:39:31 » |
|
If I left click the link I get a 403, if I right click and "save link to disk" I am able to download the file. The file though is not playable on my system either. Win2k (SP4), Quicktime, Realplayer, xvid.
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #11 - Posted
2004-05-22 14:45:57 » |
|
Ouch sorry ! My video shooter use a very bad codec...
I've updated the file, it's now an uncompressed avi.
(tiscali is a bad server for homesite, so you should do a right click -> download to get the file...)
|
|
|
|
|
oNyx
|
 |
«
Reply #12 - Posted
2004-05-22 14:51:50 » |
|
Can't download it. Tried the link for yourself? 
|
|
|
|
|
|
oNyx
|
 |
«
Reply #14 - Posted
2004-05-22 15:21:03 » |
|
Kinda nice to use uncompressed avi in that case. No keyframes - so you can jump from frame to frame (back and forth).
It appears that the content of the backbuffers differs. Only looking at the even frames looks ok and only looking at the odd frames is also ok, but together they look just weird.
I guess you've clearing disabled, but draw the background without disabling blending. Enable clearing and it should be ok (as a test) or just disable blending at the end of your particle stuff.
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #15 - Posted
2004-05-22 15:36:10 » |
|
My clearing stuff is enabled : glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); and init part : glClearDepth(1.0); glDepthFunc(GL_LEQUAL); glEnable(GL_DEPTH_TEST); I guess you've clearing disabled, but draw the background without disabling blending. Enable clearing and it should be ok (as a test) or just disable blending at the end of your particle stuff. Clearing is enabled and I draw the background with blending disabled  . I've tested what you suggest but it doesn't work too... Strange isn't it ? I think I'm gonna leave my classic particle system and try to convert it so as it will use ARB_point_sprite extension... Maybe it will work (only on newer card :-/). Thanks for your help anyway ! If someone knows how to solve this problem, you're welcome  Chman
|
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #16 - Posted
2004-05-22 16:01:18 » |
|
Hi again  I find something new after doing some tests ! So, I've tested using the ARB_point_sprite extension, I get the same problem. BUT : the particle engine starts flickering only when it's creating a new particle ! If I made a single particle pass (no particle re-created), it works very well ! (using the extension or not) That's pretty strange... So I think it's not an OpenGL problem... Maybe I'm doing something wrong with Java... I'll post some news about it ! Chman
|
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #17 - Posted
2004-05-22 16:27:59 » |
|
Stay calm chman... Stay calm... I'm so STUPID ! But STUPID ! Ok I've resolved the "problem"... Which wasn't a real problem... I was just making some stupid things with my for loop and the return statement, so the particle was re-creating some thounsand times each frame or wasn't created at all... Stupid I say... Forgive about this useless post which only makes you see how stupid I can be when I'm tired  Chman
|
|
|
|
|
|
|
Matzon
|
 |
«
Reply #19 - Posted
2004-05-23 16:55:25 » |
|
cool, planning a live demo via webstart?
|
|
|
|
Chman
Junior Member  
Nothing more that... Java games are cool !
|
 |
«
Reply #20 - Posted
2004-05-23 18:01:42 » |
|
I'll make a webstart demo when my engine will be usable because at this time, it's just a package with class utilities... No real scenegraph  I'll make a demo showing all the features of the engine ! Chman
|
|
|
|
|
|