Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How to generate lightmaps and import to Java3D?  (Read 1433 times)
0 Members and 1 Guest are viewing this topic.
Offline William

Junior Member




No Exit


« Posted 2003-03-27 19:47:50 »

Does anyone have experience of generating lightmaps of models created in a 3D-modeling app and importing those lightmaps along with the original textured models into Java3D?

I am using Maya and currently exporting to Java3D as VRML using the Xj3D loader. The only ways that I have been able to think of to get global illumination into my scenes are either to bake the lighting into my single-textures or write a multi-texture export plugin for Maya and a Java3D loader that can handle multitextures. Neither solution works for me and I welcome any tips on solving this problem, even if it means switching to 3DS Max or some other modeling application.
Offline Mithrandir

Senior Member




Cut from being on the bleeding edge too long


« Reply #1 - Posted 2003-03-28 06:16:24 »

Be very careful of the differences in outputs of a non-realtime modelling tool like Maya and realtime rendering code like the X3D spec (which is implemented courtesy of Java3D). A classic example of this is multitextured bump maps. Maya exports a height map, where realtime rendering engines what normal maps.

The X3D specification includes MultiTexture support, so have a read up on it. Xj3D supports about 90% of that spec.

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Offline William

Junior Member




No Exit


« Reply #2 - Posted 2003-03-28 08:40:03 »

Ok, thanks, so I might not have to write my own Java3D loader if I use X3D's mulitexturing support. Can you perhaps also recommend a way to get the data from Maya to X3D?

I guess it might be possible to export two files (possibly in the VRML format) with identical geometry from Maya, one with UV-sets and texture paths to the lightmaps and the other with the same info for the detail textures, and combine the info from both the files into multitexture nodes in a tool like X3D-Edit. However, the VRML-to-X3D converter that X3D-Edit uses does not seem to work correctly on the VRML-files that Maya generates (when I use Xj3D to load the X3D files that X3D-Edit creates from Maya's VRML files a bunch of  "No field: textureCoordinate for: TextureCoordinate" lines are spewed out and the textures are messed up).

Xj3D correctly loads VRML files from Maya directly though, can Xj3D somehow be used to convert from VRML to X3D? or do you know of any other ways to convert models from Maya to X3D?

Btw, I know Maya has support for generating the types of lightmaps that I want. It's actually quite surprising to see that no one seems to have done these very basic game-tasks in Java before. I hope to contribute some info on the subject in the form of a tutorial or library if I get it worked out during my project (5 weeks to go).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline shawnkendall

Senior Member





« Reply #3 - Posted 2003-03-28 13:45:02 »

From William
" Btw, I know Maya has support for generating the types of lightmaps that I want. It's actually quite surprising to see that no one seems to have done these very basic game-tasks in Java before. I hope to contribute some info on the subject in the form of a tutorial or library if I get it worked out during my project (5 weeks to go)."

May people have done these very basec game-tasks in Java before (but I think you mean Java3D). :-) just not using X3D or VRML because those exporters are limited.  We wrote our own loaders for Maya and Creator before that.  Both support multitexture as well as many of things not available in typical loaders and free formats (for example special collision geometry)

This is also typical of traditional game production, that is to write your own exporter and loader for your render engine., and it's how we have been doign it for some time.

Perhaps someone on the forum here knows of other Java3D loaders that support more functionality and that are available on the web other than www.j3d.org's otherwise it's roll your own time.  Besides writting a loader is one of THE BEST exercises you can do to understand the particular render engine you may be working with.

Good coding!

Shawn Kendall
Cosmic Interactive, LLC
http://www.facebook.com/BermudaDash
Offline Mithrandir

Senior Member




Cut from being on the bleeding edge too long


« Reply #4 - Posted 2003-03-28 17:34:42 »

Quote
Can you perhaps also recommend a way to get the data from Maya to X3D?


Maya 4.5 has an X3D-XML exporter. It was written back in September so it is a fraction out of date, but not much. I believe you can find it in the developer SDK kit.


Quote
combine the info from both the files into multitexture nodes in a tool like X3D-Edit. However, the VRML-to-X3D converter that X3D-Edit uses does not seem to work correctly on the VRML-files that Maya generates


X3D-Edit is a bit out of date relative to Xj3D, that tracks the spec by the minute (at least the CVS version does!).  There may be a few bugs though, so send us anything you find that really looks correct and we'll check it out.

Quote
can Xj3D somehow be used to convert from VRML to X3D?


Yes. In the latest development releases we have an example converter application that allows you to convert both directions and to either of the X3D file formats.  They're still a bit underdevelopment, but they seem to work well enough for all our tests so far.

Shawn: I track all the known loaders at http://www.j3d.org/utilities/loaders.html. If people have sent me a link to their loader, it's on there. Plenty more than just what is available in the code repository (although I would like to encourage more!).

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Offline William

Junior Member




No Exit


« Reply #5 - Posted 2003-03-29 14:56:05 »

Wow, Maya does indeed have an X3D exporter (polyX3DExporter) in the devkit. Yes, it is too out of date to be able to export directly to Xj3D, but I can live with having to make small corrections to the files. Worse, however, is that it does not seem to support multitexturing either. When it encounters a layered shader it just exports one of the textures as a standard image texture.

Btw, nice work on Xj3D, it seems to work very well for the great majority of files. I will try its VRML-to-X3D converter on Monday to see if I can use the solution where I export each scene as two single-textured VRML files and manually combine their texture nodes.
Offline William

Junior Member




No Exit


« Reply #6 - Posted 2003-04-01 06:25:31 »

Update for the records. I solved the problem by calculating and exporting vertex colors in Maya. I then combine the object color (interpolated from the vertex colors) with the texture color using the modulate mode in my Java3D code.

The bad thing about this solution is that the geometry need to be heavily subdivided in order for this to look good. However, that is acceptable for my application since my scene is small and easily culled (two rooms with a twisted pathway between then) and since it is an exhibition piece that is only supposed to run smoothly on fast hardware (2Ghz P4 with 512 Mb ram and Nvidia Ti4600 128 Mb graphics card).
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (9 views)
2014-08-31 22:59:12

TehJavaDev (22 views)
2014-08-28 18:26:30

CopyableCougar4 (27 views)
2014-08-22 19:31:30

atombrot (40 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (34 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (71 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!