isee v3.5.1-stable
but how to intall this version?
isee v3.5.1-stable
but how to intall this version?
the commit seems to be included since 3.4.0-alpha1
i dont use the SDK but i would guess you can replace the corresponding jars
if you switch to gradle you can just update the dependencies
can you show the output “OpenGL Renderer Information” when you start the app?
You dont strictly NEED the above commit because your graphics card should support the inverse function as well as the mat3 constructor, but the renderer seems to want to use an older version, do you use appSettings.setRenderer(…) ?
maybe appSettings.setRenderer(AppSettings.LWJGL_OPENGL3) is worth a shot, it should create a 3.2 core profile and then use the 150 version which will include the inverse and mat3 constructor)
i am not using setRenderer
how to use it correctly? example please
what libraries to replace and where?
my porject libs
engine folders
It’s been a long time since i did it like that so I might be wrong. “sources” are the sources so that you can open them with Control + left click on some object in the SDK and see the source code. “libs” are what you need to run your application.
Copy your project somewhere so you have a backup.
Download the version that you want to use, replace the .jars in the “lib” folder with you new jars. In case the download includes jme3-xxx-sources.jar files (i dont know, maybe you can download them separately) place them in the “sources” folder.
It is way easier using gradle
somewhere you probably have a main(String[] args) method that does something like
MyApplication app = new MyApplication();
AppSettings settings = new AppSettings(true);
...
app.setSettings(settings);
app.start();
or similar. simply add
settings.setRenderer(AppSettings.LWJGL_OPENGL3)
again the output of your application, where it says “OpenGL Renderer Information” would be interesting
ant -f /home/ivan/CastleClient -Dnb.internal.action.name=run run
init:
Deleting: /home/ivan/CastleClient/build/built-jar.properties
deps-jar:
Updating property file: /home/ivan/CastleClient/build/built-jar.properties
compile:
run:
мар. 27, 2022 10:54:12 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.3.0-stable
I create gradle project
how to update libraries with gradle?
In the dependencies
section of your build script (“build.gradle” or “common.gradle” depending on the type of project) there will be entries for “jme3-core” and other libraries with names beginning with “jme3-”. Usually that’s where the versions are specified.
For instance, if your script has
dependencies {
implementation 'org.jmonkeyengine:jme3-core:3.3.0-stable'
}
then change it to
dependencies {
implementation 'org.jmonkeyengine:jme3-core:3.5.1-stable'
}
Sometime buildscripts have the JMonkeyEngine version in a variable like so:
dependencies {
compile 'org.jmonkeyengine:jme3-core:' + jme3Version
runtimeOnly "org.jmonkeyengine:jme3-desktop:${jme3Version}"
}
in which case you find where the jme3Version
variable is set and change it there.
i update dependecies
plugins {
id 'java'
id 'application'
}
group 'com.mygame'
version '1.0'
sourceCompatibility = 1.8
mainClassName = "com.mygame.Main"
repositories {
jcenter()
}
project.ext {
jmeVer = '3.5.1-stable'
}
project(":assets") {
apply plugin: "java"
buildDir = rootProject.file("build/assets")
sourceSets {
main {
resources {
srcDir '.'
}
}
}
}
dependencies {
implementation "org.jmonkeyengine:jme3-core:$jmeVer"
implementation "org.jmonkeyengine:jme3-desktop:$jmeVer"
implementation "org.jmonkeyengine:jme3-lwjgl:$jmeVer"
}
jar {
manifest {
attributes 'Main-Class': "$mainClassName"
}
}
now i have error:
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
com.jme3.asset.AssetNotFoundException: /Models/main_scene.glb
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:439)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:444)
at com.mygame.Main.simpleInitApp(Main.java:21)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:139)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)
at java.base/java.lang.Thread.run(Thread.java:834)
Before invoking loadModel()
, either:
AssetManager
to look in the “./assets” folder or elseAssetManager
looks, such as the classpath.Taking the first approach:
assetManager.registerLocator("./assets", FileLocator.class);
Spatial mainScene = assetManager.loadModel("Models/main_scene.glb");
Attempting answer your next question, in order for JMonkeyEngine to load models in the non-native “GLB” format, you’ll need to add the “jme3-plugins” library to your “build.gradle” build script:
implementation "org.jmonkeyengine:jme3-lwjgl:$jmeVer"
implementation "org.jmonkeyengine:jme3-plugins:$jmeVer"
FileLocator doe’s not exists
can’t import for this file
My gradle file
plugins {
id 'java'
id 'application'
}
group 'com.mygame'
version '1.0'
sourceCompatibility = 1.8
mainClassName = "com.mygame.Main"
repositories {
jcenter()
}
project.ext {
jmeVer = '3.5.1-stable'
}
project(":assets") {
apply plugin: "java"
buildDir = rootProject.file("build/assets")
sourceSets {
main {
resources {
srcDir '.'
}
}
}
}
dependencies {
implementation "org.jmonkeyengine:jme3-core:$jmeVer"
implementation "org.jmonkeyengine:jme3-desktop:$jmeVer"
implementation "org.jmonkeyengine:jme3-lwjgl:$jmeVer"
implementation "org.jmonkeyengine:jme3-plugins:$jmeVer"
}
jar {
manifest {
attributes 'Main-Class': "$mainClassName"
}
}
if i add string implementation “org.jmonkeyengine:jme3-plugins:$jmeVer”
in my main class import stops working (dos not exists packages)
Model load without errors
but invisible
in blender
in jmonkey black screen
Did you add a light to your scene?
…you will also need a light probe for PBR materials or the ambient lighting will look dark. (You can either generate one or use a standard one.)
public void simpleInitApp() {
assetManager.registerLocator("./assets", FileLocator.class);
Spatial mainScene = assetManager.loadModel("Models/main_scene.glb");
rootNode.attachChild(mainScene);
DirectionalLight sun = new DirectionalLight();
sun.setColor(ColorRGBA.White);
sun.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
rootNode.addLight(sun);
}
i add ligth but model invisible
can you test my glb model?
I dont have time to look into it but from what i remember
and
should result in version 150 being used, shouldnt it?
import com.jme3.asset.plugins.FileLocator;
Next thing to check is if the model is so huge that the camera starts inside of it.
Easiest way might be to print the world bound of the model.
System.out.println(mainScene.getWorldBound());
BoundingBox [Center: (-0.33333334, 0.51925063, 0.0) xExtent: 0.6666666 yExtent: 0.51925063 zExtent: 1.0]
Hard to say… as mentioned before, ambient light will be messed up without a light probe so if that wall is not facing the light then it will be black.
It’s weird because you shouldn’t have to do that unless you disabled it before.