OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Trouble with texture to export to OSGJS format


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
MathieuKatharos
Newbie


Joined: 27 Jul 2015
Posts: 3

PostPosted: Mon Jul 27, 2015 7:58 am    Post subject:
Trouble with texture to export to OSGJS format
Reply with quote

Good morning,

I'm hardly trying to export a 3d model to OSGJS format but I have trouble with the textures. Concretely the textures do not appear in the OSGJS output file.

What I did:

1) initially I had an IVE file that an infographist gave me. I tried the two commands osgconv File.ive File.osgjs.
I got this return:
Fatal nb colors 1 != 1349
can't save osgjs file
Unable to write to output stream


Idem with osgconv -O OutputTextureFiles File.ive File.osgjs

2) I tried (just for test) to convert the ive file to osg format. It works but the output file has no texture.

3) I asked the infographist to export the model to OBJ format with 3dsMAX. So I got an OBJ file and a MTL file.
Then I do osgconv -O OutputTextureFiles File.obj File.osgjs
I get some warnings such as

*** line not handled *** :map_refl C:\myFolder\myFolder2\maps\refmap_txt.jpg
Warning: [ReaderWriterOBJ::convertElementListToGeometry] Some faces from geometry '' were reversed by the plugin


Strange because the JPG file really exists in my fodler ! I have other JPG files and I have no warning message for them.
Anyway, I do not think it is the source of the problem.
But the final OSGJS does not appear with textures, as no texture is exported. The geometry is correct.



Apparently I did something wrong, but I don't know where !
If someone has an idea about this export issue ?


Thanks a lot and have a good day,
Mathieu
Back to top
View user's profile Send private message
Jordi Torres
Guest





PostPosted: Mon Jul 27, 2015 5:30 pm    Post subject:
Trouble with texture to export to OSGJS format
Reply with quote

Hi Mathieu, 

You should use the gles plugin to export to avoid the Fatal nb colors error.
See: https://github.com/cedricpinson/osgjs/wiki/Convert-model-with-OSG


For the images: 


You can try to convert first your model to osgb and write the textures to disk and then convert to osgjs using $osgconv file.osgb.gles file.osgjs, if the osgjs plugin is not writting to disk the images.
Also you can save them as inline images in the same osgjs file. The resultant file will be bigger though, but it is ok for quick tests. For example drag & dropping here http://webkeux.com/osgjs-test/ 



One more thing, if you have the images as separate files you must use a server (http server I mean). 


Cheers. 


2015-07-27 9:59 GMT+02:00 Mathieu Bartillat < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Good morning,

I'm hardly trying to export a 3d model to OSGJS format but I have trouble with the textures. Concretely the textures do not appear in the OSGJS output file.

What I did:

1) initially I had an IVE file that an infographist gave me. I tried the two commands osgconv File.ive File.osgjs.
I got this return:
Fatal nb colors 1 != 1349
can't save osgjs file
Unable to write to output stream

Idem with osgconv -O OutputTextureFiles File.ive File.osgjs

2) I tried (just for test) to convert the ive file to osg format. It works but the output file has no texture.

3) I asked the infographist to export the model to OBJ format with 3dsMAX. So I got an OBJ file and a MTL file.
Then I do osgconv -O OutputTextureFiles File.obj File.osgjs
I get some warnings such as

*** line not handled *** :map_refl C:myFoldermyFolder2mapsrefmap_txt.jpg
Warning: [ReaderWriterOBJ::convertElementListToGeometry] Some faces from geometry '' were reversed by the plugin

Strange because the JPG file really exists in my fodler ! I have other JPG files and I have no warning message for them.
Anyway, I do not think it is the source of the problem.
But the final OSGJS does not appear with textures, as no texture is exported. The geometry is correct.



Apparently I did something wrong, but I don't know where !
If someone has an idea about this export issue ?


Thanks a lot and have a good day,
Mathieu

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64482#64482





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Jordi Torres

------------------
Post generated by Mail2Forum
Back to top
MathieuKatharos
Newbie


Joined: 27 Jul 2015
Posts: 3

PostPosted: Tue Jul 28, 2015 7:37 am    Post subject:
Reply with quote

Hello Jordi, thanks a lot for your answer.

I tried to use the gles plugin with the command described in the link you sent, but osgconv.exe crashes (no log message).

I tried with an IVE and an OSGB files as input.

So far the only way I have not to receive the error (Fatal nb colors 1 != 1349) is to get an OBJ from the graphist without texture. Texture files are in a separate folder /images.
Then I can convert to an OSGJS format.
In this file I have references to the textures in some fields, such as:
"File": "images\\base_age.tga",

But when I load it, even if I put textures in the folder //images, they do not appear.
And in the Chrome console I have this:
warning use white texture as fallback instead of images\valve.tga
warning use white texture as fallback instead of images\alu_txt.tga

and so on...

Ah, and sorry but the drag and drop does not do anything in your link. I tested with different osgjs files.
Back to top
View user's profile Send private message
Jordi Torres
Guest





PostPosted: Tue Jul 28, 2015 7:45 am    Post subject:
Trouble with texture to export to OSGJS format
Reply with quote

Hi Mathieu, 

2015-07-28 9:37 GMT+02:00 Mathieu Bartillat < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hello Jordi, thanks a lot for your answer.

I tried to use the gles plugin with the command described in the link you sent, but osgconv.exe crashes (no log message).



Could you share the model, or a part of it to reproduce the crash? That will help to debug. 


 I tried with an IVE and an OSGB files as input.
Quote:

So far the only way I have not to receive the error (Fatal nb colors 1 != 1349) is to get an OBJ from the graphist without texture. Texture files are in a separate folder /images.
Then I can convert to an OSGJS format.
In this file I have references to the textures in some fields, such as:
"File": "images\base_age.tga",

But when I load it, even if I put textures in the folder //images, they do not appear.
And in the Chrome console I have this:
warning use white texture as fallback instead of imagesvalve.tga
warning use white texture as fallback instead of imagesalu_txt.tga
and so on...

That message means that osgjs is not founding the textures. Are you using a server like apache or similar? It is a must to work with separate textures, also the textures should be in the route they appear in the osgjs file. 


By the way did you try the inline textures feature?


Cheers. 




 
Quote:
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64503#64503





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Jordi Torres

------------------
Post generated by Mail2Forum
Back to top
MathieuKatharos
Newbie


Joined: 27 Jul 2015
Posts: 3

PostPosted: Tue Jul 28, 2015 10:37 am    Post subject:
Reply with quote

Well, I can show this very simple example with one IVE and 2 texture files.

I cannot convert directly to OSGJS format.
IVE --> OSGJS does not work (Fatal nb colors log)
IVE --> OSG works
OSG --> OSGJS does not work (Fatal nb colors log)
OSG --> OBJ works
OBJ --> OSGJS works but I have 2 logs saying that some faces were reversed by the plugin
And if I try to load this model (with the textures in a folder \\images at the same location of the java script file) I cannot see the texture. Chrome moans:
warning use white texture as fallback instead of images\tree_03.tga

Thanks in advance !
Mathieu
Back to top
View user's profile Send private message
Jordi Torres
Guest





PostPosted: Wed Jul 29, 2015 6:41 am    Post subject:
Trouble with texture to export to OSGJS format
Reply with quote

Ok I will try to be clerarer:

1. Can you please share the ive model or a part of it to debug the crash? Otherwise is almost impossible to know what is happening.

2. Tga textures are not supported in the browser, you'll need to write them out to jpg. 


3. You must use the gles pseudo-reader to avoid the Fatal nb colors.


4. Did you try the inline images feature? Did it work? 


  Cheers. 

Quote:

Well, I can show this very simple example with one IVE and 2 texture files. I cannot convert directly to OSGJS format. IVE --> OSGJS does not work (Fatal nb colors log) IVE --> OSG works OSG --> OSGJS does not work (Fatal nb colors log) OSG --> OBJ works OBJ --> OSGJS works but I have 2 logs saying that some faces were reversed by the plugin And if I try to load this model (with the textures in a folder \images at the same location of the java script file) I cannot see the texture. Chrome moans: warning use white texture as fallback instead of imagestree_03.tga Thanks in advance ! Mathieu



2015-07-28 9:45 GMT+02:00 Jordi Torres < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hi Mathieu, 

2015-07-28 9:37 GMT+02:00 Mathieu Bartillat < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hello Jordi, thanks a lot for your answer.

I tried to use the gles plugin with the command described in the link you sent, but osgconv.exe crashes (no log message).



Could you share the model, or a part of it to reproduce the crash? That will help to debug. 


 I tried with an IVE and an OSGB files as input.
Quote:

So far the only way I have not to receive the error (Fatal nb colors 1 != 1349) is to get an OBJ from the graphist without texture. Texture files are in a separate folder /images.
Then I can convert to an OSGJS format.
In this file I have references to the textures in some fields, such as:
"File": "images\base_age.tga",

But when I load it, even if I put textures in the folder //images, they do not appear.
And in the Chrome console I have this:
warning use white texture as fallback instead of imagesvalve.tga
warning use white texture as fallback instead of imagesalu_txt.tga
and so on...

That message means that osgjs is not founding the textures. Are you using a server like apache or similar? It is a must to work with separate textures, also the textures should be in the route they appear in the osgjs file. 


By the way did you try the inline textures feature?


Cheers. 




 
Quote:
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64503#64503





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
Jordi Torres










--
Jordi Torres

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Render to texture with GL3. Raizel General 3 Tue May 23, 2017 10:33 am View latest post
No new posts How to replace the texture data in th... xdfanfan General 1 Wed Apr 05, 2017 12:44 pm View latest post
No new posts Multitexture: projection a texture on... Ekaterina General 2 Mon Feb 06, 2017 1:48 pm View latest post
No new posts Problem building .dae format file us... vinothrajendran4 VirtualPlanetBuilder [vpb] 4 Wed Jan 18, 2017 12:05 pm View latest post
No new posts How to set texture coordinates Ekaterina General 0 Fri Jan 13, 2017 5:39 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP