Skip to main content

[JAVA3D-INTEREST] RenderingAttributes Delay and Frame Number Bug

2 replies [Last post]
Anonymous

Hello,

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

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.

Thanks,
-mike

[BehaviorTiming.java]
[DebugCanvas3D.java]
[FrameBehavior.java]
---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kevin Rushforth

Hi Mike,

I can reproduce both of the problems that you reported: 1) seemingly
inconsistent delays in updating attributes; 2) intermittent problem
where the frame counter isn't always incremented correctly when
setMinimumFrameCycleTime is used. Please file two separate issues (but
you only need to attach the program to one of them and refer to it from
the other). Thanks.

-- Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Matthew Hilliard

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

That's very interesting. I submitted a bug (276066 -- never responded to)
where WakeupOnElapsedFrames(0) stopped being triggered entirely after an
arbitrary number of frames.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net