[Collada] I know, another topic about lost Material and Textures but

Hello all,

Im loanding a collada model by using:



You should have some warning outputs regarding unable to load textures. It will give the full path that it is looking for the texture. What does this say?

Nothing,… i can post my log:



12-giu-2007 17.47.49 com.jme.app.BaseGame start
INFO: Application started.
12-giu-2007 17.47.49 com.jme.system.PropertiesIO <init>
INFO: PropertiesIO created
12-giu-2007 17.47.49 com.jme.system.PropertiesIO load
INFO: Read properties
12-giu-2007 17.47.49 com.jme.app.BaseSimpleGame initSystem
INFO: jME version 1.0 alpha
12-giu-2007 17.47.49 com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
12-giu-2007 17.47.49 com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
12-giu-2007 17.47.49 com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:

Can you provide me with the box model?

yes,



g32.it



is a really stupid holed box with meshsmoth :smiley:



Thanks for your interest.

Try using Phong shading instead of Blinn shading  :slight_smile: That should do the trick!



If not, try ColladaMax 3.02 instead of 3.03 (and still Phong instead of Blinn).

Uuumh… good and maybe bad notices…  :expressionless:



i get this error by exporting using Phong shading:



java.io.FileNotFoundException: F:Achilleterzoworkspace3DWorldbindatatexturesC__Documents_and_Settings_Achilleterzo_Desktop_test_3d_dirt.jpg-surface (Impossibile trovare il file specificato)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(Unknown Source)
   at java.io.FileInputStream.<init>(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
   at java.net.URL.openStream(Unknown Source)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:368)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:350)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:257)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:222)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:218)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:167)
   at com.jmex.model.collada.ColladaImporter.loadTexture(ColladaImporter.java:2549)
   at com.jmex.model.collada.ColladaImporter.processTexture(ColladaImporter.java:2524)
   at com.jmex.model.collada.ColladaImporter.processPhong(ColladaImporter.java:2396)
   at com.jmex.model.collada.ColladaImporter.processTechniqueCOMMON(ColladaImporter.java:2373)
   at com.jmex.model.collada.ColladaImporter.fillMaterial(ColladaImporter.java:1671)
   at com.jmex.model.collada.ColladaImporter.processEffects(ColladaImporter.java:1635)
   at com.jmex.model.collada.ColladaImporter.processCollada(ColladaImporter.java:630)
   at com.jmex.model.collada.ColladaImporter.load(ColladaImporter.java:273)
   at com.jmex.model.collada.ColladaImporter.load(ColladaImporter.java:253)
   at indoorTest.IndoorTest.openModel(IndoorTest.java:371)
   at indoorTest.IndoorTest.simpleInitGame(IndoorTest.java:116)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:497)
   at com.jme.app.BaseGame.start(BaseGame.java:65)
   at indoorTest.IndoorTest.main(IndoorTest.java:78)
15-giu-2007 16.45.52 com.jme.util.TextureManager loadImage
AVVERTENZA: loadImage(URL file, boolean flipped): defaultTexture used because - F:Achilleterzoworkspace3DWorldbindatatexturesC__Documents_and_Settings_Achilleterzo_Desktop_test_3d_dirt.jpg-surface (Impossibile trovare il file specificato)
java.io.FileNotFoundException: F:Achilleterzoworkspace3DWorldbindatatexturesC__Documents_and_Settings_Achilleterzo_Desktop_test_3d_dirt.jpg-surface (Impossibile trovare il file specificato)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(Unknown Source)
   at java.io.FileInputStream.<init>(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
   at java.net.URL.openStream(Unknown Source)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:368)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:350)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:257)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:226)
   at com.jme.image.Texture.read(Texture.java:986)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:245)
   at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:441)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:429)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:533)
   at com.jme.scene.state.TextureState.read(TextureState.java:563)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:245)
   at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:151)
   at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:82)
   at com.jmex.model.collada.ColladaImporter.processTriMesh(ColladaImporter.java:3039)
   at com.jmex.model.collada.ColladaImporter.processMesh(ColladaImporter.java:2978)
   at com.jmex.model.collada.ColladaImporter.processGeometry(ColladaImporter.java:2583)
   at com.jmex.model.collada.ColladaImporter.processCollada(ColladaImporter.java:646)
   at com.jmex.model.collada.ColladaImporter.load(ColladaImporter.java:273)
   at com.jmex.model.collada.ColladaImporter.load(ColladaImporter.java:253)
   at indoorTest.IndoorTest.openModel(IndoorTest.java:371)
   at indoorTest.IndoorTest.simpleInitGame(IndoorTest.java:116)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:497)
   at com.jme.app.BaseGame.start(BaseGame.java:65)
   at indoorTest.IndoorTest.main(IndoorTest.java:78)
15-giu-2007 16.45.53 com.jme.util.TextureManager loadImage
AVVERTENZA: loadImage(URL file, boolean flipped): defaultTexture used because - F:Achilleterzoworkspace3DWorldbindatatexturesC__Documents_and_Settings_Achilleterzo_Desktop_test_3d_dirt.jpg-surface (Impossibile trovare il file specificato)
15-giu-2007 16.45.53 com.jme.scene.Node <init>



I have tried to remove TextureKey.setOverridingLocation(textures); also and nothing change.

And Yes!



ColladaMax 3.0.2 and Phong solve out my problem…



Now a question, whats about exporting with bump and other maps?

Achilleterzo said:

And Yes!

ColladaMax 3.0.2 and Phong solve out my problem...

Now a question, whats about exporting with bump and other maps?


Glad it works now! I'm also having trouble with ColladaMax 3.03 so for now I stay with 3.02. I already bugged Mojomonk with it  :D

As far as I know Mojo is also working on ways to support other mappings, like specular or bump mapping. We'll just have to be patient.

I (or someone else) will be adding support to the importer for secondary mappings (normal, specular, glow, etc) as we need them. That is, as our shader system comes on line here at work. You may have to wait awhile for it though, as it will be done on an as-needed basis. However, my primary concern for you guys is that the FeelingSoft exporter supports these maps. The FeelingSoft exporter seems to not support many advanced features.

Many thanks for the answers and help :slight_smile:



Im trying to set a textureState by hand at the moment with a GLSL but i have some trouble to pass the texture name to the shader…



Is a simple GLSL Normal shader, any suggestion?



my shader code:



Fragment glsl:


uniform vec4 fvAmbient;
uniform vec4 fvSpecular;
uniform vec4 fvDiffuse;
uniform float fSpecularPower;

uniform sampler2D diffuseMap;
uniform sampler2D normalMap;

varying vec2 Texcoord;
varying vec3 ViewDirection;
varying vec3 LightDirection;

void main( void )
{
   vec3  fvLightDirection = normalize( LightDirection );
   vec3  fvNormal         = normalize( ( texture2D( normalMap, Texcoord ).xyz * 2.0 ) - 1.0 );
   float fNDotL           = dot( fvNormal, fvLightDirection );

   vec3  fvReflection     = normalize( ( ( 2.0 * fvNormal ) * fNDotL ) - fvLightDirection );
   vec3  fvViewDirection  = normalize( ViewDirection );
   float fRDotV           = max( 0.0, dot( fvReflection, fvViewDirection ) );

   vec4  fvBaseColor      = texture2D( diffuseMap, Texcoord );

   vec4  fvTotalAmbient   = fvAmbient * ( fvBaseColor );
   vec4  fvTotalDiffuse   = fvDiffuse * fNDotL * ( fvBaseColor );
   vec4  fvTotalSpecular  = fvSpecular * ( pow( fRDotV, fSpecularPower ) );

   gl_FragColor = ( fvTotalAmbient + fvTotalDiffuse + fvTotalSpecular );
}



Vertex glsl:


uniform vec3 fvLightPosition;
uniform vec3 fvEyePosition;

varying vec2 Texcoord;
varying vec3 ViewDirection;
varying vec3 LightDirection;
  
attribute vec3 rm_Binormal;
attribute vec3 rm_Tangent;
  
void main( void )
{
   gl_Position = ftransform();
   Texcoord    = gl_MultiTexCoord0.xy;
   
   vec4 fvObjectPosition = gl_ModelViewMatrix * gl_Vertex;
  
   vec3 fvViewDirection  = fvEyePosition - fvObjectPosition.xyz;
   vec3 fvLightDirection = fvLightPosition - fvObjectPosition.xyz;
    
   vec3 fvNormal         = gl_NormalMatrix * gl_Normal;
   vec3 fvBinormal       = gl_NormalMatrix * rm_Binormal;
   vec3 fvTangent        = gl_NormalMatrix * rm_Tangent;
     
   ViewDirection.x  = dot( fvTangent, fvViewDirection );
   ViewDirection.y  = dot( fvBinormal, fvViewDirection );
   ViewDirection.z  = dot( fvNormal, fvViewDirection );
  
   LightDirection.x  = dot( fvTangent, fvLightDirection.xyz );
   LightDirection.y  = dot( fvBinormal, fvLightDirection.xyz );
   LightDirection.z  = dot( fvNormal, fvLightDirection.xyz );
  
}