Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Flickering problem  (Read 2202 times)
0 Members and 1 Guest are viewing this topic.
Offline 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 Smiley)

Thanks
Chman

Edit: forgot to say that I've tested the code with and withouth vSync... But it doesn't change anything...
Offline abies

Senior Member





« 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
Offline 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 Smiley

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!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« 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?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline 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 ?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« 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. Sad 'Flickering' is a pretty vauge description though, how about a screenshot?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline 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 Smiley It's not visible on static images...
I will try to make a little video shot and post the link here asap !
Offline 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.zip

Sorry 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 Tongue)... Don't know if it can help.

Chman
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« 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.

弾幕 ☆ @mahonnaiseblog
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #9 - Posted 2004-05-22 14:24:19 »

I get a 403 error, I wonder if I have Opera configured wrongly somewhere...

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline 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.

http://ribot.co.uk - design agency focused on mobile
http://www.retrospecs.co.uk - online vintage eyewear store
Offline 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...)
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #12 - Posted 2004-05-22 14:51:50 »

Can't download it. Tried the link for yourself? Smiley

弾幕 ☆ @mahonnaiseblog
Offline Chman

Junior Member




Nothing more that... Java games are cool !


« Reply #13 - Posted 2004-05-22 14:57:46 »

Here it is Smiley Just an error in the link :
http://hourdel.chez.tiscali.fr//videoshot.zip
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« 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.

弾幕 ☆ @mahonnaiseblog
Offline 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);

Quote
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 Tongue. 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 Smiley

Chman
Offline Chman

Junior Member




Nothing more that... Java games are cool !


« Reply #16 - Posted 2004-05-22 16:01:18 »

Hi again Smiley

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
Offline 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 Tongue

Chman
Offline Chman

Junior Member




Nothing more that... Java games are cool !


« Reply #18 - Posted 2004-05-23 15:23:34 »

Hi !

I've finished my particle engine ! It's very powerful and can handle scripting (with DynamicJava) to make custom effects, so I can do what I want with that engine Smiley
Oh, if the graphics card support it, it can use ARB_point_sprite for faster rendering Smiley

Here are some screenshots if you wanna see it in action :

http://hourdel.chez.tiscali.fr/images/snap007.jpg
http://hourdel.chez.tiscali.fr/images/snap006.jpg
http://hourdel.chez.tiscali.fr/images/snap005.jpg

Thanks for your help Smiley

Chman
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #19 - Posted 2004-05-23 16:55:25 »

cool, planning a live demo via webstart?

Offline 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 Smiley

I'll make a demo showing all the features of the engine !

Chman
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (18 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (31 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (41 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (60 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!