Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 01:39:55 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)VM Crash ShapeAtomPeer.drawGeometry()
Pages: [1]
Print
Author Topic: VM Crash ShapeAtomPeer.drawGeometry()  (Read 1081 times)
mhermann
Enjoying the stay
*
Offline Offline

Posts: 46


View Profile Email
« on: 12. October 2007, 06:46:37 am »

Code:
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  com.sun.opengl.impl.GLImpl.glDrawArrays(III)V
J  org.xith3d.render.jsr231.ShapeAtomPeer.drawGeometry(Lorg/xith3d/render/RenderPeer;Lorg/xith3d/render/RenderOptions;Ljavax/media/opengl/GL;Lorg/xith3d/scenegraph/GeometryArray;Z)I
J  org.xith3d.render.jsr231.ShapeAtomPeer.render(Ljavax/media/opengl/GL;Lorg/xith3d/render/prerender/ShapeAtom;Lorg/xith3d/scenegraph/Appearance;Lorg/xith3d/scenegraph/Geometry;Lorg/xith3d/scenegraph/GeometryArray;ZZZZZZLorg/xith3d/render/RenderPeer;Lorg/xith3d/render/RenderOptions;Z)I
J  org.xith3d.render.jsr231.ShapeAtomPeer.renderAtom(Lorg/xith3d/render/RenderPeer;Lorg/xith3d/render/RenderOptions;Lorg/xith3d/render/prerender/RenderAtom;JJZJ)I
J  org.xith3d.render.RenderPeer.renderAtom(Lorg/xith3d/render/RenderOptions;Lorg/xith3d/render/prerender/RenderAtom;Lorg/xith3d/scenegraph/View;JJJZ)I
J  org.xith3d.render.jsr231.RenderPeerImpl.drawBin(Ljavax/media/opengl/GL;Lorg/xith3d/render/RenderOptions;Lorg/xith3d/render/prerender/RenderBin;Lorg/xith3d/scenegraph/View;Lorg/openmali/spatial/bodies/Frustum;JIJJZ)I
j  org.xith3d.render.jsr231.RenderPeerImpl.renderMain(Ljavax/media/opengl/GL;Lorg/xith3d/render/RenderOptions;Lorg/xith3d/scenegraph/View;Lorg/openmali/spatial/bodies/Frustum;Lorg/xith3d/render/prerender/RenderBinProvider;Lorg/openmali/vecmath2/Matrix3f;JIJJZ)I+104
j  org.xith3d.render.jsr231.RenderPeerImpl.render(Ljava/lang/Object;Lorg/xith3d/scenegraph/View;Lorg/xith3d/render/prerender/BackgroundCache;Ljava/util/List;ZJJJLorg/xith3d/picking/PickRequest;)Ljava/lang/Object;+520
j  org.xith3d.render.jsr231.CanvasPeerImplBase.doRender(Lorg/xith3d/scenegraph/View;Lorg/xith3d/render/prerender/BackgroundCache;Ljava/util/List;ZJJJLorg/xith3d/picking/PickRequest;)Ljava/lang/Object;+21
j  org.xith3d.render.jsr231.CanvasPeerImplAWT.display(Ljavax/media/opengl/GLAutoDrawable;)V+164
j  com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V+29
j  javax.media.opengl.GLCanvas$DisplayAction.run()V+80
j  com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+418
j  javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run()V+35
j  java.awt.event.InvocationEvent.dispatch()V+11
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26
j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+156
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 12. October 2007, 10:26:44 am »

This has been reported here. Unfortunately I never get this kind of crash. So it would be very helpful, if you could send me a testcase, where this happens.

Marvin
Logged
mhermann
Enjoying the stay
*
Offline Offline

Posts: 46


View Profile Email
« Reply #2 on: 14. October 2007, 03:17:55 pm »

I don't know the reason but this works:

Code:
if (isShadow){
    for (int i=0;i<shapes.size();i++){
        Appearance app = shapes.get(i).getAppearance();
        Material mat = app.getMaterial();
        mat.setAmbientColor(Colorf.BLACK);
        mat.setDiffuseColor(Colorf.BLACK);
        mat.setSpecularColor(Colorf.BLACK);
        mat.setEmissiveColor(Colorf.BLACK);
    }
}else{
// init transparency
    TransparencyAttributes transparencyAttrs = new TransparencyAttributes(
    TransparencyAttributes.BLENDED, 0f,TransparencyAttributes.BLEND_ONE,
    TransparencyAttributes.BLEND_SRC_ALPHA);

    ColoringAttributes colorAttr = new ColoringAttributes();
    colorAttr.setShadeModel(ColoringAttributes.NICEST);

    for (int i=0;i<shapes.size();i++){
        Shape3D shape = shapes.get(i);
        Appearance app = shape.getAppearance();
        if (shape.getName().endsWith("_transparent")){
            app.setTransparencyAttributes(transparencyAttrs);
        }
        Material mat = app.getMaterial();
        mat.setShininess(100);
        mat.setLightingEnabled(true);   
        mat.setSpecularColor(new Colorf(1.0f,1.0f,1.0f));
    }
}

and this doesn't work (unfortunatly I can't highlight the changes with a color in the code)

Code:
if (isShadow){
    Texture texture = null;
    PolygonAttributes polyAttrs = new PolygonAttributes(PolygonAttributes.CULL_BACK);
    for (int i=0;i<shapes.size();i++){
        Appearance app = shapes.get(i).getAppearance();
        app.setTexture(texture);
        app.setPolygonAttributes(polyAttrs);       
        Material mat = app.getMaterial();
        mat.setAmbientColor(Colorf.BLACK);
        mat.setDiffuseColor(Colorf.BLACK);
        mat.setSpecularColor(Colorf.BLACK);
        mat.setEmissiveColor(Colorf.BLACK);
    }
}else{
    // init transparency
    TransparencyAttributes transparencyAttrs = new TransparencyAttributes(
        TransparencyAttributes.BLENDED,0f,                            TransparencyAttributes.BLEND_ONE,                 TransparencyAttributes.BLEND_SRC_ALPHA);

    ColoringAttributes colorAttr = new ColoringAttributes();
colorAttr.setShadeModel(ColoringAttributes.NICEST);

    TextureAttributes textureAttr = new TextureAttributes();
textureAttr.setTextureMode(TextureAttributes.MODULATE);
textureAttr.setPerspectiveCorrectionMode(TextureAttributes.NICEST);

    for (int i=0;i<shapes.size();i++){
        Shape3D shape = shapes.get(i);
        Appearance app = shape.getAppearance();
        if (shape.getName().endsWith("_transparent")){
            app.setTransparencyAttributes(transparencyAttrs);
        }
        Material mat = app.getMaterial();
        mat.setShininess(100);
        mat.setLightingEnabled(true);   
        mat.setSpecularColor(new Colorf(1.0f,1.0f,1.0f));
        app.setTextureAttributes(textureAttr);
    }
}
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 14. October 2007, 03:26:36 pm »

Are you trying to use Xith's shadowing system? Or are you using your own one? If you're using your own, how do you do it? If you're using Xith's shadows, don't do this for now. It is broken.

I would guess, that the crash depends on setting a texture/TextureAttributes or not, since this is what I changed right before these problems had been reported. Could you please try, if just commenting out the texture stuff "enables/disables" the crash?

Marvin
Logged
mhermann
Enjoying the stay
*
Offline Offline

Posts: 46


View Profile Email
« Reply #4 on: 14. October 2007, 04:20:58 pm »

Yes it enables/disables the crash
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 14. October 2007, 05:02:30 pm »

Since you know, that I don't get the crash in the testcases, it would ge cool, if you could post a more complete testcase, where you get this crash. I mean, the two codings above are quite different. Maybe you could just modify one of the xith-tk testcases to reproduce the crash.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 16. October 2007, 10:10:39 am »

The problem should be fixed now. (see here).
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic