Directional light causes blinking trouble

A scenegraph with one directional light source: DirectionalLight(color3f, new Vector3f(-1, 0, -1))
Everything is OK until the camera looks exactly into the direction where the light comes from, ie looks at vector (+1, 0, +1) ): then the light calculation of the surfaces starts to “jump” at the slightest movement of the camera or the models.

Webstart example (in case my webspace messes up the MIME type please try the zipped jnlp)

The camera targets at the mentioned direction (where the directional light comes from). The origin (white cube) is on the left behind the camera.
Since the statue models rotate, their surfaces’s position changes slowly and so the light calculation goes blinking.
Same effect with the bottom plate: if you change the camera view (pressed middle mouse button) its surface is being lit in a blinking manner, too.

It could be I am doing something wrong. It could also be I detected a small bug. Anybody knows more please? Thanks. :slight_smile:

PS: The used Xith version I downloaded from CVS one or two days agao.

Another question please on the same Webstart, but not related to the blink effect…
There are ~100 models rotating. When I move the camera (cursor keys) every few seconds there’s a jerky (stutter?) effect: the app pauses for ~ 0.5 secs and then continues.
When you hit the pause key, the rotation stops, so the models don’t call their transformgroup’s setTransform method anymore. Now let’s move the camera again and no jerky movement; or at least: much rarer.

{Edit} Thanks to Kev’s hint it’s the GC.

Try turning on -verbosegc when you run, see if you’re getting any Full GCs during running, if you are, most likely your pauses.

Kev

[quote]Try turning on -verbosegc when you run, see if you’re getting any Full GCs during running, if you are, most likely your pauses.
[/quote]
Thanks for that smart hint. Yes, there are full GCs. In Pause mode (with camera movement) no/hardly full GCs.

So it’s the GC causing the stutter… maybe it’s inside Xith3d, because I always call setTransform on the 100 models’ TransformGroups, but if all are in the view frustum, the “full GC” comes much more often compared to when only a few models are visible… (if all are in the frustum, there’s much more GC memory being created…)

Is there maybe something with Xith3d I can do to decrease the “full GCs”?

To minimize problems caused by full GC, we should try to minimize memory allocations inside Xith3D rendering engine. abies already did a lot to reduce memory allocations, but there are still some things to do in that area.

Yuri

[quote]To minimize problems caused by full GC, we should try to minimize memory allocations inside Xith3D rendering engine. abies already did a lot to reduce memory allocations, but there are still some things to do in that area.
[/quote]
I see. Great to hear.
To know now where the reason for the stutter effect is (full GC), it good. An encircled “problem/optimization area” is way better… :slight_smile: Thanks for all your efforts.

Btw back to the original topic name: the light “flickering”: what do you mean could cause that one?

[quote]back to the original topic name: the light “flickering”: what do you mean could cause that one?
[/quote]
On the list for investigation.

Yuri

Situation with full GC should be much better now. Check latest CVS version.

Yuri