render problem?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
clemens
Posts: 7
Joined: Sun May 24, 2009 7:21 am

render problem?

Post by clemens »

hello,

i have built a simple scene with a flat plane and some boxes.
the boxes are controlled via a physics engine (pal with bullet).
when they fall to the ground, some of these boxes start to flicker - even
when they are motionless. in my example there are 500 boxes and approx.
10-20 boxes are flickering. and there is just another effect: if i look around
with the camera controlled with the mouse, often the boxes at the screen-borders start to flicker or just disappear. this effect is less if i set the gravity
from 10 to 1, so that all action is very slow. may this be a rendering issue?

regards,
clemens
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe the boxes have zbuffer issues, which lead to flickering due to minimal gravity movements?
clemens
Posts: 7
Joined: Sun May 24, 2009 7:21 am

Post by clemens »

if this is a zbuffer problem, how to solve? i have set up the
graphics device with 32 bits instead of 16 - same issue.

i have changed the physics engine from bullet to newton - same issue.

i have disabled pal and worked directly with bullet to see if its a pal problem - boxes still start to flicker.

what i can see is, that if i turn the camera around a flickering box it stops this behavior sometimes when i change the way i look at it. if it is located in the center of my view it disappears - if it is located under the center it is visible. i can repeat this endless for this object.

is this maybe due to the camera-viewmatrix? i have already tried to change the near-far clipping plane with no result. maybe the aspect-ratio?
any hints?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

maybe a culling problem (node->setAutomaticCulling) ???
but this shouldn't if the box is in the center of the screen, except if it's a bounding box problem (try node->setDebugDataVisible)...

if nothing works, make a download or post code that reproduces the error so we can check it... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

I don't know much things with physic engines, but have you checked this?:

- Pausing the simulation, to see if the physic engine was not forgetting some objects from frame to frame.

- Tryied with variants of the number of boxes (start with 10, 20, 30, and so on)

- Checked when the RENDER is done from the physic engine, could be out of sync with the IRRlicht begin scene and endscene commands.

Culling distance would be a good thing to check also as mentionned by Acki.
clemens
Posts: 7
Joined: Sun May 24, 2009 7:21 am

Post by clemens »

ok. i tried the following proposals from Acki and Christian (thanks!):

-changed the number of boxes - flickering/disappearing starts approx. > 70 boxes

-same thing if i stop physics calculation/updating box-position/rotation

-tried out node->setAutomaticCulling() with EAC_OFF, EAC_BOX and EAC_FRUSTUM_BOX - but its always the same effect

so this is not due to the physics engine, i think. but i have seen another interesting thing: at program start i place all boxes at a grid position and stack some layers of 7x7 boxes so that i have 7x7x e.g.10 = 749 boxes. they are floating in the air until the application starts and the physics engine adds the gravity. if i stop physics, so that the boxes stand still - there is no flickering except at the screen-borders. if i turn around, i can see this effect always at the borders - lines of boxes disappear at once. if i let all boxes fall to the ground so that they are cluttered, this effect can be seen everywhere on the screen - not just at the borders.

by the way, this happens in opengl- and also directx-mode.

which issues do i have to look for if i set the setDebugDataVisible-method? maybe there are some useful informations - as Acki suggested?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

clemens wrote:which issues do i have to look for if i set the setDebugDataVisible-method? maybe there are some useful informations - as Acki suggested?
mainly I thought using it to check if the bounding boxes are correct (for culling)... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Maybe its problem with your "placement" code for boxes, so one box is overlaping other that can cause flickering?
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
clemens
Posts: 7
Joined: Sun May 24, 2009 7:21 am

SOLVED

Post by clemens »

i 've got it!

until now i have created all objects with mSmgr->addOctTreeSceneNode() because the code documentation says "a good method for rendering scenes with lots of geometry".

i simply replaced this by mSmgr->addMeshSceneNode() - and the flickering is gone! ! ! :D

i go now and play a bit with stacks... :wink:

thank you all for your proposals! good to know that people offer help here.
Post Reply