Skip to main content

1.4.0x Exception

6 replies [Last post]
shawnkendall
Offline
Joined: 2003-06-10

Hi all,
I am getting a new Exception in 1.4.0x when I load up (addChild) a model we were previously using fine.

Not much more to say than that...
Here's the dump:

java.lang.NullPointerException
at javax.media.j3d.TextureRetained.checkSizes(TextureRetained.java:406)
at javax.media.j3d.TextureRetained.setLive(TextureRetained.java:942)
at javax.media.j3d.AppearanceRetained.doSetLive(AppearanceRetained.java:896)
at javax.media.j3d.AppearanceRetained.setLive(AppearanceRetained.java:878)
at javax.media.j3d.Shape3DRetained.doSetLive(Shape3DRetained.java:1101)
at javax.media.j3d.Shape3DRetained.setLive(Shape3DRetained.java:926)
at javax.media.j3d.GroupRetained.childDoSetLive(GroupRetained.java:2142)
at javax.media.j3d.GroupRetained.doSetLive(GroupRetained.java:2197)
at javax.media.j3d.BranchGroupRetained.setLive(BranchGroupRetained.java:166)
at javax.media.j3d.GroupRetained.childDoSetLive(GroupRetained.java:2142)
at javax.media.j3d.GroupRetained.doSetLive(GroupRetained.java:2197)
at javax.media.j3d.BranchGroupRetained.setLive(BranchGroupRetained.java:166)
at javax.media.j3d.SwitchRetained.childDoSetLive(SwitchRetained.java:787)
at javax.media.j3d.GroupRetained.doSetLive(GroupRetained.java:2197)
at javax.media.j3d.SwitchRetained.setLive(SwitchRetained.java:354)
at javax.media.j3d.GroupRetained.childDoSetLive(GroupRetained.java:2142)
at javax.media.j3d.GroupRetained.doSetLive(GroupRetained.java:2197)
at javax.media.j3d.BranchGroupRetained.setLive(BranchGroupRetained.java:166)
at javax.media.j3d.GroupRetained.childDoSetLive(GroupRetained.java:2142)
at javax.media.j3d.GroupRetained.doSetLive(GroupRetained.java:2197)
at javax.media.j3d.BranchGroupRetained.setLive(BranchGroupRetained.java:166)
at javax.media.j3d.TransformGroupRetained.childCheckSetLive(TransformGroupRetained.java:1217)
at javax.media.j3d.GroupRetained.checkSetLive(GroupRetained.java:1544)
at javax.media.j3d.GroupRetained.checkSetLive(GroupRetained.java:1467)
at javax.media.j3d.GroupRetained.doAddChild(GroupRetained.java:494)
at javax.media.j3d.GroupRetained.addChild(GroupRetained.java:467)
at javax.media.j3d.Group.addChild(Group.java:271)
at cosmic.engine.UpdatableBranchGroup.setGeometry(UpdatableBranchGroup.java:125)
at cosmic.engine.EntityUtil.loadGeometry(EntityUtil.java:307)
at cosmic.gui.ModelViewer.loadModelFile(ModelViewer.java:2218)
at cosmic.gui.ModelViewer.access$000(ModelViewer.java:40)
at cosmic.gui.ModelViewer$45.construct(ModelViewer.java:2145)
at cosmic.gui.SwingWorker$2.run(SwingWorker.java:107)
at java.lang.Thread.run(Thread.java:595)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
shawnkendall
Offline
Joined: 2003-06-10

I should also mention that I discovered this when my HUD stopped rendering all of a sudden. I thought I must have broke something in our engine, but a graph traversal showed it attached but not visible for some reason.

Eventually, I attempt to load in our viewer (same engine but no game code), and then I got this error.

shawnkendall
Offline
Joined: 2003-06-10

Ok I must have set something up very wrong while reworking part of our engine because now I get this exception all over the place when doing live addChild() (projectiles being added for the first time, etc)

The thing that is new in our entity code is that we added a switch to the node stack our entity class wraps.

Perhaps switches are involved in the live addChild error?

kcr
Offline
Joined: 2004-03-17

Could you try this with 1.5? The checkSizes method was rewritten for issue 172. You will hopefully get a more helpful error message from 1.5, which should make it easier to diagnose your problem.

-- Kevin

shawnkendall
Offline
Joined: 2003-06-10

OK this is what I got:
java.lang.IllegalArgumentException: Texture: mipmap image not set at level1
at javax.media.j3d.TextureRetained.setLive(TextureRetained.java:952)
at javax.media.j3d.AppearanceRetained.doSetLive(AppearanceRetained.java:896)

So I Googled the old error and saw it was connected to mipmap BUT I haven't alter any code related to that (I dont' think :-), I have however updated my nVidia drivers.
In any case...what does that mean message mean? (for me and posterity on this forum)

kcr
Offline
Joined: 2004-03-17

This exception means that the image component was not set (i.e., is null) for mipmap level 1 in a texture object that is created with a mipmap mode of MULTI_LEVEL_MIPMAP.

Java 3D prior to 1.5.0 was rather haphazzard in checking for this case.

-- Kevin

shawnkendall
Offline
Joined: 2003-06-10

Ok, I fixed it and here's what I did.

Previously, my model loader and texture loader used:

int mipMapMode = Texture.MULTI_LEVEL_MIPMAP;

as my default (and also "Best Texture") settings.

In the past, that worked even when I only had one BASE_LEVEL image (i.e. Java3D or drivers? was autogenerating the next mip levels) and used generate mipmaps.

Changing my defaults and Best setting to:

int mipMapMode = Texture.BASE_LEVEL;

fixed the issue.

Thanks