[JAVA3D-INTEREST] RenderingAttributes Delay and Frame Number Bug
I am trying to work out some synchronization issues that I am having. I
posted about them earlier.
After some testing, from what I can tell, RenderingAttributes are taking
affect in 1 frame in some cases and 2 frames in others. The attached test
case shows the problem. With the flag FRAME_DELAY set to true, the delay is
introduced in the frame behavior, which causes the appearance to be delayed
by two frames as expected: a change in behavior frame 3 will not appear
until render frame 5.
However with the flag FRAME_DELAY set to false, the delay is in the view
cycle time, which causes the appearance to be delayed by only one frame: a
change in behavior frame 3 will appear in render frame 3.
>From what I can gather the frame number as reported by the view in a
behavior that wakes on elapsed frames of 0 will be the frame number of the
frame about to be rendered, not the one that the behavior woke in response
This seemingly different behavior causes problems since appearance changes
that happen in the view delay cycle will be applied at a different time than
slow behaviors that occur concurrently with a rendering frame. I may be
misinterpreting the results, but this is how the numbers appear to me.
Aside from all this, there appears to be a bug in WakeupOnElapsedFrames(0)
where the behavior may get triggered multiple times for the same frame
number. In the attached test case if the behavior detects that it has
already run for the given frame, it will throw an exception. Looking at the
output this may not be a behavior problem, but rather a bug in the frame
counter. The canvas sequence of preRender, renderField, postRender, postSwap
is called twice with the same frame number. This bug is not reliably
reproducible which leads me to think it is a threading problem in J3D.
Lowering the FRAME_TIME field to about 500 allows it to show-up faster,
however how long it takes to show up varies between runs. I am not sure how
rendering the same frame number twice will impact other parts of the system.
I will submit these as issues if someone can confirm them.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com