Skip to main content

Tech: RenderAtom, RenderAtomInfo, ...

8 replies [Last post]
pepe
Offline
Joined: 2003-06-10

Hello.
I'm currently fighting a weird bug inside RenderAtom that throws a NullPointerException (L:288) because of localToVworld becoming null.
That bug comes under weird conditions, i am actually not sure where it actually comes from. So, i'm trying to grasp the inner concepts of implementation, as they are not documented (or at least, i did not find that documentation ) and debug myself. The actual conditions are as follows:
i have an universe with two lights and a shape. That shape sometimes sees its geometry swapped to an other (IndexedTriangleFanArray to Text3D) and swapped back. Unless IndexedTriangleFanArray has normals, everything is fine. Once i add them, >beng< ... The error seems very unrelated to how i managed to make it come out.
As far as i understood, rendering takes places as a list of RenderAtom that represent a Shape and its geometries to be rendered. Is that right, even if too simplistic?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jada
Offline
Joined: 2004-03-17

Yes, the document is in the code. :-)
RenderAtom (RA) is the small render unit, and is group into RenderMolecule (RM). The renderer thread will traverse the RenderBin structure, down to the visible RM and access its RA for rendering.
Please file as issue with issue tracker, you've certainly found a bug.

thanks,
- Chien.

pepe
Offline
Joined: 2003-06-10

i've been able to get more in my problem and analyse a bit more.
Nevertheless, i'm still learning guts and it's a bit painful. Hopefully, the patent text did clarify things, but not all.
I've found that:
-- the RenderMolecule does not change its primaryRenderMethod from Text3DRenderMethod when geometry gets changed, which obviously looks wrong to me, as the geometry is not text anymore.
-- the RenderMolecule is the same instance for the text geometry render and the next one that uses the TriangleArray. That sounds odd.
-- If i don't create my TriangleArray with normals, everything works.
-- If i also change appearance (in fact, reassign same appearance) right after changing geometry, everything works.

Trying to figure out everything myself showed to be a very long task, so i'm asking for your advice. Any idea where to look at first?
Thanks a lot !

kcr
Offline
Joined: 2004-03-17

You've wandered into the most complicated portion of the Java 3D system. We considered annotating the RenderBin subsystem with one of the following quotes:

"Here there be dragons"
"Abandon hope all ye who enter here"
"You are in a maze of twisty passages, all alike"

We decided to leave it up to the reader to figure out which one is most appropriate. :)

On a more serious note, the fact that the RenderMolecule is not being recreated is either symptomatic of the problem, or is the primary cause of the problem. Since resetting the Appearance fixes the problem, I would guess that it's some sort of bug in the handling of dirty bits. Java 3D tries in many cases to determine whether something changed before doing extra work. If there is a bug in the "did something change?" logic, then this sort of problem will occur.

Perhaps Chien can comment further, since he's more familiar with the inner workings of the RenderBin than I am.

-- Kevin

pepe
Offline
Joined: 2003-06-10

i propose "you entered a mad scientist lair. beware !".. ;)
( too bad we can't add james Bond's theme to a source code. :) )
Well, that update thing was my first conclusion. I need to find where and why that RenderMolecule is not changed/updated, and the mystery will be solved, i think. That multithreaded model makes it real hard to debug. I think you had hard times setting all this up.

[edit] can't type..

jada
Offline
Joined: 2004-03-17

Do you have a test program where we can work together ?

pepe
Offline
Joined: 2003-06-10

no test program, unfortunatly. i have too few time to make one. (reason why tracking the bug takes so long)
Nevertheless, i can send you my application. You don't need to swear that you will not spread it around, just try not to. (sources of incriminated parts can be sent)
It is a 80Kb jar, and you'll get the bug (reproductible each time) in a few clicks.

jada
Offline
Joined: 2004-03-17

With our current resource level, we strongly encourage user to send us test program on reporting issue if possible. We have a long list of features and TODOs to achieve for 1.3.2 and 1.4. We appreciate any help we get in achieving our release goals.

pepe
Offline
Joined: 2003-06-10

is that a yes, or no?
i won't submit the program with a bug report, i don't want it to be public.
I understand you will accept any help, and i will do as much as i can. Tell me 'yes', and the program will be in your mailbox (once i know which to use)