L3DT users' community
Large 3D terrain generator

Import to Pand3D

Correspondence concerning plugins and scripts; development, use, bugs and ideas.

Import to Pand3D

Postby Ionus » Sat Jul 30, 2016 6:59 am

It is my intention to take terrain and associated files from L3DT to Panda3D. Exploring both ends of the pipeline I found it is full of possible errors. A search at Panda3D forums (https://www.panda3d.org/forums/search.p ... earchx.y=0) found several critical problems. Is it possible for someone to have a look at those and write a guide or even a plug-in? I hasten to add ot looks like most of the problems are at the Panda3D end.
Ionus
Member
 
Posts: 10
Joined: Sat Jul 30, 2016 6:29 am

Re: Import to Pand3D

Postby Aaron » Mon Aug 08, 2016 11:46 am

Hi Ionus,

I apologise for the delay in my reply. From my perusal of those posts on the Panda3D forum, the difficulties generally seem to be 1) cutting the heightmap into tiles, 2) handling the y-axis flip between L3DT and Panda3D, and 3) baking the terrain mesh into egg files. Are there any other difficulties I've missed?

The first two items can already be addressed by options in L3DT, but could be automated by a plugin for Panda3D exports. It is possible also that I could write an egg exporter plugin for L3DT also (docs seem OK), either by exporting all the requisite files and then calling an existing converter (e.g. obj2egg.py), or by natively writing my own egg exporter. Do you have a small example egg terrain file that I could pull apart?. I find it's always easiest to implement a format with an example to look at. If so, please e-mail to aaron@bundysoft.com, and I'll pop this on my to-do list. Please note that no ETA will be forthcoming, as I'm currently working on some core improvements that take priority over file exporters.

Also, are there any restrictions on sizes that need to be enforced by the exporter? For example, does the heightmap need to be a power of two, or a power of two plus one, or can it be any size? Does it need to be square, or are unequal widths and heights OK? Are there any vertex / polygon count limits that need to be observed? Do the textures need to be powers of two in size? Do texture tiles need edge duplication to prevent seams in Panda3D, or does Panda3D do this internally? etc.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: Import to Pand3D

Postby Ionus » Mon Aug 15, 2016 4:29 am

Hi Aaron,

My understanding is that for 2) there is no requirement but perhaps a text to explain that in Panda3D, if the lower quality setColorMap is used then the y axis will need to be flipped, but not if setTexture is used.

For 1) display of terrain in P3D is limited by the graphics card, therefore cutting the heightmap into smaller tiles say 512 x 512 (in reality 513 x 513) would be better but multiple textures on the same terrain involve writing your own shaders.
The quality of terrain graphics is superior in L3DT and this does not easily carry across, though I am not sure why.

For 3), baking terrain into egg files, I believe there might be a problem with the need for a collision mesh.

I am just a noob to game programming, but if I might make a suggestion : wrap the data to be exported as a .x file. P3D just loves .x files, sort of a native format and the internal engine to P3D then has no trouble making its own .egg file.

You're doing great work and its appreciated.

Ionus
Ionus
Member
 
Posts: 10
Joined: Sat Jul 30, 2016 6:29 am

Re: Import to Pand3D

Postby Aaron » Wed Aug 24, 2016 12:09 pm

Hi Ionus,

Sorry for the slow reply. L3DT already supports the X file format. Use 'File->Export->Export optimised mesh'. This also supports splitting the map into tiles.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: Import to Pand3D

Postby Ionus » Thu Aug 25, 2016 12:40 am

Hi Aaron,
yes, I am aware of the .x export but I was saying that for recording purposes in case anyone arrives here with the same request in mind. It still would be nice to have a exporter solely for Panda3D. Blender is being "merged" with P3D to show live updates to models and actors. Now something similar would be nice for L3DT !!

Cheers!
John
Ionus
Member
 
Posts: 10
Joined: Sat Jul 30, 2016 6:29 am

Re: Import to Pand3D

Postby Aaron » Fri Aug 26, 2016 1:05 pm

Hi John,

Please pardon my short attention span (I've been working on a number of other projects in the mean time), but the requirements of the Panda3D exporter seem to boil down to a tiled .x mesh exporter with matching texture map per tile, yes? No additional data, and only a y-axis flip on the textures if using a 1:1 texture map for vertex colours. Speaking of which, is the 'setColorMap' method widely used? There surely can't be any advantage in using vertex colours instead of textures?

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: Import to Pand3D

Postby Ionus » Sat Aug 27, 2016 1:48 pm

Hi Aaron,

I am trying to gain knowledge of Panda whilst do lots of models and data entry, so my understanding might be wrong, but I think setTexture would always be used first even if setColorMap was used, the idea being to load texture(s) then to vary them by vertex colors, so the axis direction change shouldn't be required.

"..the requirements of the Panda3D exporter seem to boil down to a tiled .x mesh exporter with matching texture map per tile, yes?" Yes. Also Panda doesnt like any light on its textures, and is capable of generating its own "extra" lighting, eg Bump Maps. That is one way and as a beginner it seems the best way.

Another way is for Panda to import as a .egg file and the latest and greatest converter is "Yet Another Blender Egg Exporter (YABEE)", ref https://www.panda3d.org/forums/viewtopic.php?t=11441 Although it is for Blender, depending on size (smaller is better) some Maps could be imported into Blender as mesh with the texture added, then exported as .egg and of course it may help you write an exporter for L3DT direct to .egg. Again, .x is quite stable going into blender compared to some other possible formats. Unsure of this method's viability for most L3DT terrains as they tend to be large.

Small maps (512x512?) can be generated using the Panda Heightfield Tesselator from the import of grey scale image Heightfields. Dont know how textures work with this internally to Panda.

One Panda internal prefers Heightfields to be 16 bit .png files. This is very new and is possibly still to be fully tested but is advertised as for huge terrains (8192x8192 or even 16384x16384)? This may turn out to be the best but it seems too early to tell. ref https://www.panda3d.org/forums/viewtopi ... 38#p106846 It doesnt seem to have a proper name but the working title of "Shader Terrain Mesh".

Cheers!
Ionus
Member
 
Posts: 10
Joined: Sat Jul 30, 2016 6:29 am


Return to Plugins and scripts

Who is online

Users browsing this forum: No registered users and 4 guests

cron