Xith3d progress

I have pretty much finished porting Magicosm to Xith3D. There are a few things I still have to do, but it is looking pretty good.

The frame rates seem comparable to Java3d, but I know there is lots I can do still to improve performance. We are also horribly CPU heavy, running at about 30 percent of the frame rate is spent calculating the next frame. I had hoped that a scene like above would render a lot faster than 41 fps at 1152x864x32, and I hope I can figure out the issues.

Does anyone know if the jogl canvas.display() returns as soon as my GL code is done, or does it wait for opengl to finish drawing and swap a frame? It would be nice to get some overlap there if possible.

I have not committed my latest Xith3d code yet, I need to clean up some debugging code I still ahve in there.

There isn’t a glFinish inside the render loop if that’s what you’re asking. At least I don’t see one in the source anywhere.

Ok thats good to know. I will have to do some profiling and see where the time is being spent. The funny thing is that before I had view frustum culling working I was rendering 200,000 triangles a frame at 23 fps, but with culling it is more like 40-50k a frame at 41.

We ran a sucessful test on Linux last night of Magicosm running on Xith3D+JOGL. It worked right the first time with no issues.

[quote]We ran a sucessful test on Linux last night of Magicosm running on Xith3D+JOGL. It worked right the first time with no issues.
[/quote]
Sweet. All the joking about “write once, debug everywhere” aside, this is the sort of thing that gives you that reassuring feeling that this Java thing is actually working.

duss animation on ase files work?

Yeah I kept saying “are you sure you are running the new version”? and he said "well unless you added shadows to Java3d then this is the new version.

Well I was jumping up and down and poured myself a glass of 30 year old Balvinie to celebrate.

Let’s see a screen shot!!!

Hi
Sounds like xith is going from strength to strength, is this the same version thats in CVS?, I dunno if I was doing something wrong but I just can’t get it to play right with polygon arrays rather than triangle arrays/fans. AC3D fromat is for polygons and getting the underlying renderer to deal with it, running on top of xith rather than Java3D would mean GL does the triangulation which means what you see in the modeler is what you see on the screen :).

If the current xith3d should be able to cope with polygon arrays then i’m doing something wrong, if it can’t, any ideas when/if it will, or am I gonna have to try and triangulate the models myself? :slight_smile:

Edit:

I just checked the latest build out, and noticed a class I already had, GeometryArray, i dunno how I missed it last time, it was probably late then too :slight_smile:
Also tried to build it with ant on a SDK without java3d installed and I still get build errors unless I build on the java3d enabled sdk, is this a known thing that just wasn’t on the top of the priority list?, I know it’s very early days yet so I don’t expect everything to have been resolved yet, just trying to guage if its ready for me to try and port my AC3D loader.

Cheers

Endolf

Endolf,

I am using Xith3D from CVS without Java3D installed for this SDK. The current build does have a few dependencies the ones which I noticed are:

vecmath.jar
j3dutils.jar

I just placed them in $JAVA_HOME/

And it built fine :smiley:

There is a free implementation of vecmath out there - and the j3dutils.jar file comes as an extra to Java3D, not part of the core IIRC

I must say that I am very impressed with what I have seen so far David, well done! Loading a Max-exported ASE file (with materials) was a breeze (well some documentation would have been nice, but that can wait ;)). The next time I am coding, I will be porting what I have done in Java3D into Xith3d (not a great deal thus far, but it’s nice to be able to keep it).

Shadows seem a little odd for more complex meshes but I understand you are working on it (and the very fact there are shadows is enough to wet my appetite!)

Cheers,

Will.

any news on Transparency? still haveing hassles here… i got and built the new build ok… code test is the same:

Shape3D shape = new Shape3D();
Appearance a = new Appearance();
a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.
POLYGON_FILL, PolygonAttributes.CULL_BACK, 0));
a.setTexture(textureWood);
Geometry g = createDoubleCube(0f, 0, 0, 0.5f, false);
a.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.5f));
shape.setAppearance(a);
shape.setGeometry(g);
tf_2.addChild(shape);

also tryed adding:

view.setTransparencySortingPolicy(view.TRANSPARENCY_SORT_GEOMETRY);

no joy still… any idea? or is it not in there yet…

Hi
Just looked again, GeometryArray isn’t any good to me at the moment as the types don’t include GEOM_POLY or what ever it will/might become

Cheers

Endolf

(now confused as to wether he is confused or not)

messing with the ASE loaded cant seem to get the materials to work. the loader says they have loaded but all comes out white.

try {
BranchGroup bg = AseFile.getModel(“test.ase”);
tf_2.addChild(bg);
} catch (Exception er) {
System.out.println("cant load mod: " + er.toString());
}

Parsing material list
Parsed material TestMaterual
Geom Object Starting
576 faces use material 0
Geom Object Torus01 parsed
Shape Torus01 using material ref 0
Getting mesh for sub-material -1 with 576 faces
Occluder found 576 faces
Occluder found 288 unique points
connected 864 edges out of 1728
starting frame speed test
Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl
OpenGL Renderer = GeForce4 460 Go/AGP/SSE2
OpenGL Version = 1.3.1
OpenGL Vendor = NVIDIA Corporation

Hi
I’m no xith expert, but from what i’ve seen you need to add your model to the universe just like in java3d and then call renderOnce() repeatidly, before the first call the screen is white, and after the last render is called the screen seems to revert to white, loop round 1000 times or something, that should draw it for a few seconds.

HTH

Cheers

Endolf

shape level transparency is not supported yet. Transparency through textures or vertex alphas is supported. I will write a transparency demo to show how this works.

cool u the man!

i worked out u need a texture are a matrial and its cool :slight_smile: tops… np there. seems u cant use the colors settings in the file. no big deal… the shadows are tops dude… very cool…

edolf:

What is GEOM_POLY? I am not familiar with that. If you mean by poly a arbitrary polygon with more than 4 sides then I am not aware that OpenGL can render such a thing… it would have to be broken down into triangles first.

glBegin will accept a GL_POLYGON for convex object rendering, but its pretty unstable. Odds are the driver will split it into triangles itself, so you’re better off doing it yourself so you don’t get unexpected results (particularly with per-vertex colours).

I’m rendering convex hulls for my 2d game, and i’ve found it works better by finding a center point (avarage of all the edge points) and using this as the anchor for a tri fan. This way the results are consistant and i get more control of the interpolated colours :smiley:

can i set the shadow volume to a different color? say less transparent?

I need to add some more support for shadows, a important one being the ability to set the color of the shadow, which would be easy to do.