Using LOD

yes, this is exacly what we was saying :slight_smile:



.blend → j3o is much diffrent than

.blend → (ogre → j3o) part in () is a part where you can add a LOD

1 Like

but now I get:



[java]ar 20, 2012 5:55:47 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalStateException: LOD levels are not set on this mesh

at com.jme3.scene.Geometry.setLodLevel(Geometry.java:153)

at com.jme3.scene.control.LodControl.controlRender(LodControl.java:181)

at com.jme3.scene.control.AbstractControl.render(AbstractControl.java:97)

at com.jme3.scene.Spatial.runControlRender(Spatial.java:560)

at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:784)

at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:794)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1117)

at com.jme3.renderer.RenderManager.render(RenderManager.java:1168)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:254)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Thread.java:619)

Mar 20, 2012 5:55:47 PM com.jme3.renderer.lwjgl.LwjglRenderer cleanup

INFO: Deleting objects and invalidating state[/java]





what I did:



I created a object.mesh.xml and I right clicked “Advanced JME Binary Convert” and imported, did it 3 times for LOD 0 , 1, and 2 (is that how it works?) and still when I run it I get that LOD levels are not set :S

manually checking the file (.mesh.xml) right click and creating LOD using Advanced JME binary is not creating any LOD levels in the file :S

they are in the j3o… they are created on import :roll:

But when I load the j3o file I get the no lod levels set error

Idk, it worked the last time I used it… @Momoko_Fan?

Idk, it worked the last time I used it.. @Momoko_Fan?


is it working on your SDK now? I updated to a nightly and wanted to make sure thats not the reason before I delete and reinstall the SDK to stable :S

Well, the way I know you by now… Please install stable, everything else will confuse you.

Well, the way I know you by now… Please install stable, everything else will confuse you.

rolling back to stable will make me lose tons of fixes in my animation.


but is it working? are you able to load a file with LODs? or more are you able to set LOD on a j3o file from the SDK? cz when I do it I am still not sure how it sets them. It looks like nothing is happening when I create these Lod levels from teh sdk :S

That recommendation was completely off anything you talked about. Nightly just isn’t for beginners like you. Do something else if what you want to do doesn’t work in stable first.

You have to do Advanced OgreXML Convert and select the proper settings for LOD generation in the dialog. If there are no issues at this point the model will have LOD.

umm when I right click the mesh.xml file, I see Advanced Jme Binary Convert is it the same thing?



and if so, when I click it I get a window like the one below, but what happens afterwards, where does it go? how can I know how many Lods I created? - even though still I get an error saying no lod levels detected.



jlJ7U.png



(right clicking the j3o file won’t give me such option)

The lod levels are in the created j3o file and are used when you load the j3o in your code.

I’m sorry, Lods in jME looks soOoOo easy and I still don’t manage to make it work:



I create a uv-sphere in blender and crank up the segments and rings a notch. Then I export using the ogre xml exporter.

This creates a .mesh, a .mesh.xml and a .material (with same name).

From the sdk (stable release, downloaded about a month ago), I can “Convert to j3o binary” with one click (<3).

But if I do “Advanced jME Binary Convert”, add some levels of Lod (tried 2,3,4) and leave the reduction % where it is (same as in image 2 posts up), all I get is some half a second activity from my hard drive followed by… nothing. No j3o created. Didn’t find a log either… so I’m kinda lost.



I’ve tried removing smoothing with no results… Then did another model, from a box this time, using subdivisions to add complexity. But the “Advanced jME Binary Convert” just seems to ignore me. Also tried changing the reduction %. Even tried generating a j3o first, in case it would add the lods to it.



Any idea what I’m doing wrong?



In case it helps:

Product Version: jMonkeyEngine SDK 3.0beta

Java: 1.6.0_21; Java HotSpot™ 64-Bit Server VM 17.0-b17

System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (jmonkeyplatform)

Check the error output. If your user rights are messed up (which seems to be the case on various users’ windows installs) it might be the ogre command line tools cannot be extracted.

Thx normen for the quick answer.



Not proud, but having checked all over the place for log files, I thought about unchecking… but lets get to the conclusion :

Unchecking the “create tangents” box makes it work here… saw someone posting an image with it checked and assumed the problem wasn’t coming from there.



Need to do some reading, but got a trail now… if only it didn’t lead straight to the 3D/maths of doom crypt.

1 Like

actually doing that worked for me as well - I was having the same issue!



However now I am getting:



[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalArgumentException: Number of remaining buffer elements is 0, must be at least 1. Because at most 1 elements can be returned, a buffer with at least 1 elements is required, regardless of actual returned element count

at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162)

at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189)

at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:237)

at org.lwjgl.opengl.GL15.glBufferData(GL15.java:169)

at com.jme3.renderer.lwjgl.LwjglRenderer.updateBufferData(LwjglRenderer.java:2040)

at com.jme3.renderer.lwjgl.LwjglRenderer.drawTriangleList(LwjglRenderer.java:2228)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMeshDefault(LwjglRenderer.java:2426)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMesh(LwjglRenderer.java:2465)

at com.jme3.material.Material.renderMultipassLighting(Material.java:874)

at com.jme3.material.Material.render(Material.java:1102)

at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:658)

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:299)

at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:351)

at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:894)

at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:850)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1126)

at com.jme3.renderer.RenderManager.render(RenderManager.java:1168)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:254)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Thread.java:619)[/java]