Link.setSharedGroup()

Link.setSharedGroup() doesn’t work properly, when rendering it throws a NullPointerException on the RenderBinProvider of the Shape3Ds contained in the Shared group.

The workaround I use is :


removeChild(link);
link.setSharedGroup(group);
addChild(link);

though it’s not particularly elegant.

Marvin, how can we fix that ?

I’m not at home at the moment. I’ll investigate it later. But does this happen in ShaderGroupTest?

Marvin

I don’t know I’ll investigate it tomorrow.

I checked that. SharedGroupTest works properly. Please check, if it does for you. If it does, please provide me an example where it doesn’t (or modify SharedGroupTest).

Marvin

Hi,

Several things done at once :

  • The Cal3D loader has now a test, with a bowman model from the game project I’m working on (I got special permissions from my art team).
  • In PrecomputedAnimatedModel.java line 115 you can see the workaround I talked about shared groups

            // FIXME : hackish
            this.removeChild(link); // COMMENT THESE LINES TO SEE THE BUG
            link.setSharedGroup(group);
            this.addChild(link); // COMMENT THESE LINES TO SEE THE BUG

  • in CalTest.java you can see how the “Transform” class is used… really, really neat.
  • light bug in CalTest : lighting is correctly rendered on the first frame, then it’s no longer active.

When all that’s fixed, that will be fine.

I’ll have a look.

Fixed.
Look at this place in the code. I’ve added a comment.

Fixed.
But the lighting is not rendered very nicely. But I believe this is due to the angularity of the model and not due to the engine.

Marvin

Surely, but, you know, it’s a bit hard to adjust lighting when it actually doesn’t work… ;D

Thanks for all, Marvin!

True… true :stuck_out_tongue:

Huh, it seems the lighting problem isn’t entirely gone… or I miss something here… Does it work for you Marvin ?

Also the LWJGL renderer doesn’t work on my computer :


KEY_0 11=48
KEY_1 2=49
KEY_2 3=50
KEY_3 4=51
KEY_4 5=52
KEY_5 6=53
KEY_6 7=54
KEY_7 8=55
KEY_8 9=56
KEY_9 10=57
KEY_A 30=65
KEY_B 48=66
KEY_C 46=67
KEY_D 32=68
KEY_E 18=69
KEY_F 33=70
KEY_G 34=71
KEY_H 35=72
KEY_I 23=73
KEY_J 36=74
KEY_K 37=75
KEY_L 38=76
KEY_M 50=77
KEY_N 49=78
KEY_O 24=79
KEY_P 25=80
KEY_Q 16=81
KEY_R 19=82
KEY_S 31=83
KEY_T 20=84
KEY_U 22=85
KEY_V 47=86
KEY_W 17=87
KEY_X 45=88
KEY_Y 21=89
KEY_Z 44=90
KEY_SPACE 57=32
No field: KEY_ENTER
KEY_ESCAPE 1=27
KEY_RIGHT 205=39
KEY_LEFT 203=37
KEY_UP 200=38
KEY_DOWN 208=40
No field: KEY_GEST_KEY_CODE
java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1217)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.renderStart(CanvasPeerImpl.java:624)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.display(CanvasPeerImpl.java:960)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.render(CanvasPeerImpl.java:1061)
	at org.xith3d.render.Renderer.renderOnce(Renderer.java:489)
	at org.xith3d.scenegraph.VirtualUniverse.renderOnce(VirtualUniverse.java:131)
	at org.xith3d.render.base.ExtXith3DEnvironment.render(ExtXith3DEnvironment.java:242)
	at org.xith3d.render.loop.RenderLoop.invokeRendering(RenderLoop.java:670)
	at org.xith3d.render.loop.RenderLoop.loopIteration(RenderLoop.java:686)
	at org.xith3d.render.loop.ExtRenderLoop.loopIteration(ExtRenderLoop.java:308)
	at org.xith3d.test.loaders.Cal3DLoaderTest.loopIteration(Cal3DLoaderTest.java:115)
	at org.xith3d.render.loop.RenderLoop.run(RenderLoop.java:812)
	at java.lang.Thread.run(Thread.java:595)
Exception in thread "Thread-4" java.lang.Error: java.lang.NullPointerException
	at org.xith3d.render.lwjgl.CanvasPeerImpl.display(CanvasPeerImpl.java:1024)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.render(CanvasPeerImpl.java:1061)
	at org.xith3d.render.Renderer.renderOnce(Renderer.java:489)
	at org.xith3d.scenegraph.VirtualUniverse.renderOnce(VirtualUniverse.java:131)
	at org.xith3d.render.base.ExtXith3DEnvironment.render(ExtXith3DEnvironment.java:242)
	at org.xith3d.render.loop.RenderLoop.invokeRendering(RenderLoop.java:670)
	at org.xith3d.render.loop.RenderLoop.loopIteration(RenderLoop.java:686)
	at org.xith3d.render.loop.ExtRenderLoop.loopIteration(ExtRenderLoop.java:308)
	at org.xith3d.test.loaders.Cal3DLoaderTest.loopIteration(Cal3DLoaderTest.java:115)
	at org.xith3d.render.loop.RenderLoop.run(RenderLoop.java:812)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
	at org.lwjgl.opengl.GL11.glGetInteger(GL11.java:1217)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.renderStart(CanvasPeerImpl.java:624)
	at org.xith3d.render.lwjgl.CanvasPeerImpl.display(CanvasPeerImpl.java:960)
	... 10 more

I’m also investigating how shadows work.

It did. But for some reason, it doesn’t anymore. I’ll investigate it.

This error appears in some situations (reproducably). But I don’t have an idea why. I have never seen the LWJGL renderer without this problem. Maybe Yuri has an answer on it, when he’s back. Or we’ll have to deeper investigate it.

Good to know. I think, you’ll have to add an Occluder to a Shape3D, which can e.g. be a quadrat. In general it is a simplified version of the shape’s bounds. Together with lights this should be sufficient to get it working. But I never tried.

Marvin

I get some strange effects with shadow rendering on.

Also, texture rendering has gone… gosh regular users don’t checkout now ^^

The problem with lights is fixed :).

Is there an example, where I can see the effect?

Marvin

Well the Cal3DLoaderTest don’t work with textures for me now. (Note : maybe it’s not committed properly cause I upgraded my Eclipse from 3.2 to 3.3M3 and my Subclipse SVN plugin is gone so tomorrow it’ll be fixed hopefully)