Hello everybody,
I’m doing some tests concerning the saving of the Materials of the 3D models.
Here is a simple code snippet:
/**
* Save Material to j3m file.
*
* @param material
* @param file
*/
private void writeJ3m(Material material, File file) {
try {
J3MExporter j3mExporter = new J3MExporter();
j3mExporter.save(material, file);
} catch (IOException e) {
e.printStackTrace();
}
}
With engine version 3.5.2-stable texture parameters are saved like this:
Material Body_Material : Common/MatDefs/Light/PBRLighting.j3md {
MaterialParameters {
EmissivePower : 3.0
BackfaceShadows : false
Roughness : 0.30151135
EmissiveIntensity : 2.0
Glossiness : 1.0
BaseColor : 0.8 0.8 0.8 1.0
ParallaxHeight : 0.05
Metallic : 0.4
NormalType : 1.0
Emissive : 0.0 0.0 0.0 1.0
NormalMap : WrapRepeat_S WrapRepeat_T "Models/Proto/body_normal.jpg"
BaseColorMap : WrapRepeat_S WrapRepeat_T "Models/Proto/body_diffuse.jpg"
Specular : 1.0 1.0 1.0 1.0
}
AdditionalRenderState {
PointSprite On
}
}
With version 3.6.0-beta1 the MinBilinearNoMipMaps
field is also added in the texture parameters.
Material Body_Material : Common/MatDefs/Light/PBRLighting.j3md {
MaterialParameters {
EmissivePower : 3.0
BackfaceShadows : false
Roughness : 0.30151135
EmissiveIntensity : 2.0
Glossiness : 1.0
BaseColor : 0.8 0.8 0.8 1.0
ParallaxHeight : 0.05
Metallic : 0.4
NormalType : 1.0
Emissive : 0.0 0.0 0.0 1.0
NormalMap : WrapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_normal.jpg"
BaseColorMap : WrapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_diffuse.jpg"
Specular : 1.0 1.0 1.0 1.0
}
AdditionalRenderState {
PointSprite On
}
}
Opening both files with the SDK editor I get this error:
Error while locating rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_normal.jpg
com.jme3.asset.AssetNotFoundException: rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_normal.jpg (Flipped)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:407)
at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:97)
at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:92)
at com.jme3.app.AppTask.invoke(AppTask.java:147)
at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:751)
at com.jme3.app.LegacyApplication.update(LegacyApplication.java:767)
at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:296)
at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:219)
at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:45)
at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:72)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:126)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:160)
at java.base/java.lang.Thread.run(Thread.java:834)
Error while locating rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_diffuse.jpg
com.jme3.asset.AssetNotFoundException: rapRepeat_S WrapRepeat_T MinBilinearNoMipMaps "Models/Proto/body_diffuse.jpg (Flipped)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:407)
at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:97)
at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:92)
at com.jme3.app.AppTask.invoke(AppTask.java:147)
at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:751)
at com.jme3.app.LegacyApplication.update(LegacyApplication.java:767)
at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:296)
at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:219)
at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:45)
at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:72)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:126)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:160)
at java.base/java.lang.Thread.run(Thread.java:834)
Loading the 3d model into a jme application there are no errors.
- I was wondering if the problem is with the SDK or the engine.
- Is it possible to specify the
WrapRepeat_S
,WrapRepeat_T
andMinBilinearNoMipMaps
parameters in the SDK editor?
Removing them from the j3m file, the editor no longer shows errors.
I’m using SDK Release 3.5-sdk2