CMOD models and normal maps

All about models for Celestia. How-to, programs, work in progress...
Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #21by Fenerit » 12.09.2016, 20:10

This do match the normalmap
dione_gaskell_2.png



dione_gaskell_2.zip
(1.36 MiB) Downloaded 341 times
Never at rest.
Massimo

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #22by FarGetaNik » 13.09.2016, 07:52

Fenerit wrote:This do match the normalmap

Hm sorry but when loading this into Celestia, the normalmap still doesn't fit with the model. Here is my cmod, it works when using png for texture and normalmap. I might post my processed Dione texture if someone is interested, it is a 14k png (86 MB).
Attachments
dione-mesh.zip
(1.14 MiB) Downloaded 367 times

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #23by Fenerit » 13.09.2016, 09:13

Good work! Happy you have solved the modelling issues. :wink: I'm interested in your Dione surface texture.
Never at rest.
Massimo

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #24by FarGetaNik » 13.09.2016, 11:55

Fenerit wrote:Good work! Happy you have solved the modelling issues. :wink: I'm interested in your Dione surface texture.
Thanks :wink: despite still not perfect but I think I have hit Celestia's limits. Ok here is my Dione texture:
https://drive.google.com/file/d/0B14NSu0PnA5xSGRkdUxsRUFRMWc/view?usp=sharing
of course it's derived from this one: http://photojournal.jpl.nasa.gov/catalog/PIA18434

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #25by CM1215 » 07.09.2017, 10:05

I'd like to know...how do you UV map a cmod mesh? That my have been the problem when I tried to apply a texture to that tethys mesh on Celestial Matters.
CM1215: Celestial master in learning.

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #26by FarGetaNik » 07.09.2017, 17:27

I made a tutorial on my process on preparing models for Celestia. You should find the answer there.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #27by CM1215 » 07.09.2017, 21:04

The tutorial that you are speaking of seems to be outdated...things aren't going the same way with me. I'm trying to apply a texture to the dione_ver512q model.

I couldn't double click anywhere to open a window to select "spherical projection". The texture on the model appears to be two textures mirrored over the sphere, each mirror taking up half of the sphere.

Exporting the model to cmod yields one file, not two, and when I load it into cmodview, it appears completely black, and I can't edit anything.

Please help. :help:
CM1215: Celestial master in learning.

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #28by John Van Vliet » 07.09.2017, 21:47

there is no need to convert the blend to a obj and THEN use Anim8tor

cmodview opens uv mapped obj meshes just fine

however there is a bug in the cmodview code the uv mapped wavfront obj mesh reads the images from the bottom up
to you need to flip the image vertically

east and west are the same but north is down and south is UP

so you are using " dione_ver512q.tab"
the table file

edit it as per the instructions earlier then run the python script on it

this gives you a obj file

open it in blender
the North is NOT UP!!! this needs to be changed and check that the prime meridian is in the center
( the 7 on the keypad for the northpole and the 1 for the prime meridian )
when it is rotated correctly fallow any of the 10's to 100's of youtube videos and guides on uv mapping

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #29by FarGetaNik » 08.09.2017, 09:07

CM1215 wrote:The tutorial that you are speaking of seems to be outdated...things aren't going the same way with me. I'm trying to apply a texture to the dione_ver512q model.

Indeed I used an older version of anim8or in that tutorial (0.98) but it should work in newer versions also. You might have to search for it online if there is a dramatic change in fnctionality.

CM1215 wrote:I couldn't double click anywhere to open a window to select "spherical projection". The texture on the model appears to be two textures mirrored over the sphere, each mirror taking up half of the sphere.

So you were able to UV map the mesh then. Only the projection was stuck on planar instead of spherical, because the double-clicking didn't work to pop up the window you can select spherical. Make sure you have the model selected, as shown in the screenshot. Then double-click anywhere on the model (or anywhere not on the UI really).

CM1215 wrote:xporting the model to cmod yields one file, not two, and when I load it into cmodview, it appears completely black, and I can't edit anything.

Did you install the cmod export script?

John Van Vliet wrote:so you are using " dione_ver512q.tab"
the table file

edit it as per the instructions earlier then run the python script on it

this gives you a obj file

If I recall correctly I wasn't able to convert the tab files for Saturns moons into obj's with that method, but it worked for some other models. This script definately needs an update to. I had to modify it slightly to work at all.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #30by CM1215 » 08.09.2017, 10:46

Like on my old CM thread, I should have been more specific. I had already converted it to obj, otherwise I wouldn't have been able to load it up.

I am using Anim8or 0.95c, so my version must be older than yours. Double clicking on the model opens a small "mesh editor" window. There is no "spherical projection" option on it.

I was also trying to UV map it on blender, but there aren't any online tutorials on how to UV map a complex planetary model...well I can't see any at least.

The UV mapping seems to be the hardest part of this whole process.
CM1215: Celestial master in learning.

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #31by Fenerit » 08.09.2017, 11:07

Maybe the UV-map is applied upon triangles and not upon quads. Do try to re-mesh the CM models to quads, either on Anim8tor or Blender and then appliyng the texture.
Never at rest.
Massimo

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #32by selden » 08.09.2017, 12:02

Anim8or's UV projection menu is only available after you have selected the "UV" button and are applying a UV mapping onto a mesh (or onto a region selected in the point-editor). While UV mapping, double click on the object. The popup menu in v1.0b (which is currently available on the Anim8or Forum) looks like this:
capture_005_08092017_080108.png
uv mapping menu
Selden

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #33by CM1215 » 08.09.2017, 12:34

Well...this new version of Anim8or seems to enjoy crashing whenever I try to apply the texture. I don't know why...perhaps it is the extremely hi-poly mesh that I'm trying to use.
CM1215: Celestial master in learning.

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #34by FarGetaNik » 08.09.2017, 12:52

How big is the mesh? If it's enough to crash anim8or, you won't have a good time loading this monster into Celestia...

What texture are you using? I remember that Anim8or doesn't load png at all, and even 4k or 8k texture will crash it. I usually work with 1k jpg copies of my textures and apply a higher-resolution one later in Celestia.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #35by CM1215 » 08.09.2017, 13:09

I was using the default Celestia Dione texture that is in the medres folder. It is a 1024x512 jpg file.

The model file in the obj format is 125 Mb in size. You can see what it looks like in this screenshot. Note that there is no texture on the model. What you see is purely the model.
dione_ver512q_anim8or.PNG


FarGetaNik wrote:If it's enough to crash anim8or, you won't have a good time loading this monster into Celestia...

Not entirely true. I have an equally hi-poly mesh that loads into Celestia just fine. The only difference is that it isn't UV mapped. It's available on my first thread on the Celestial Matters forums. Here is a screenshot:
Tethys_Celestia.PNG
CM1215: Celestial master in learning.

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #36by FarGetaNik » 08.09.2017, 13:21

Wow the biggest model I am using is 15 MB... I just realized I have an equally large model of Mimas lying around on my hard drive :eh:

In that case I am out of ideas. If you are willing to share your obj model I could try it myself, or if you can tell me how you created it to begin with. As I stated, I wasn't able to convert the models of Saturn's moons into obj using that Python script.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #37by selden » 08.09.2017, 13:42

fyi: the current version of Anim8or can use png image textures.
Selden

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #38by CM1215 » 08.09.2017, 13:58

How about I do both?

Here is the download link for the obj: https://drive.google.com/open?id=0B5A59f3et_cJTmNuMTVGNFRMeTg

As for using the script, there are some things you must do that have not been explained... (This is for a Windows system)

1. Download and install Python 2.7. Be sure to let it install to it's default folder, which should be C:\Python27

2. Get the script and put it into the Python27 folder.

3. Go to this thread: http://forum.celestialmatters.org/viewtopic.php?f=4&t=854&sid=16067675f432ca5f7a1f61ac0f3aeba9 and follow JohnVV's instructions on how to fix the .tab file to make it compatible with the script. His post should be the 5th one down.

4. Take your modified .tab file and put it in the Python27 folder.

5. Open the Windows (not Python) Command Prompt. It should start out with the directory being on C:\Users\<YourUserName>. This is not where you want to be. Into the prompt, type "cd.." (without the quotes and with both dots) repeatedly until your directory is back on the root C: drive. Once you are there, type "cd Python27" (again without the quotes) into the prompt. You should now have C:\Python27 as your directory.

6. Type this into the prompt:

Code: Select all

python pdsVertexTAB2obj.py NameOfTabFile.tab NameOfOBJFile.obj


7. It should lock up for a second or 2, but after that, you should have a modeller-ready obj file.

If something goes wrong, such as if Python errored, check that you fixed the .tab file correctly. If something still goes wrong, check that you have the files where they should be, which is in the Python27 folder. If something still goes wrong, let me know and I'll see what I can do.

Edit: I forgot to mention that the script only works on Gaskell models. I don't know how to convert the models by other people.
CM1215: Celestial master in learning.

Avatar
Topic author
FarGetaNik M
Posts: 484
Joined: 05.06.2012
With us: 12 years 5 months
Location: Germany

Post #39by FarGetaNik » 10.09.2017, 11:30

CM1215 wrote:Here is the download link for the obj: https://drive.google.com/open?id=0B5A59f3et_cJTmNuMTVGNFRMeTg

Ok thank you :) I was able to UV map the mesh in anim8or, as you can see here:

dione-uvmapped.jpg


However I had problems converting it into a cmod. I could export it as cmod, and spend a lot of time loading the files to stich them together into an ascii cmod. But cmodview was not able to open this file. Does anyone know if there is a limit to the file size cmod can load? It is a 211 MB ascii cmod after all. And maybe the 256p mesh will provide nearly as much detail as the 512p one, as it looks quite smooth at most areas.

But here is the UV mapped obj for you, maybe you can convert it yourself.
https://drive.google.com/open?id=0B14NSu0PnA5xR2xZYW5GZ3VSZkE

Thanks for the tutorial, I have to look into this in depth later. I have to reinstall python... well I was using pyhton 3 so maybe that's the reason I failed.

Avatar
CM1215 M
Posts: 221
Joined: 30.08.2017
Age: 22
With us: 7 years 2 months
Location: Ohio, U. S. A.

Post #40by CM1215 » 10.09.2017, 17:35

FarGetaNik wrote:But here is the UV mapped obj for you, maybe you can convert it yourself.
Thank you very much!

I am apparently using either an older or newer version of the cmod export script than you, for it still only exports 1 file. But this single file still retains the UV mapping, for when I loaded it into Celestia, the texture and model both rendered excellently. This different version does the material and model combining for me, so I don't have to. The only problem I found was that the model is incorrectly oriented. Surprisingly, I only had to rotate the model 180 degrees in the y-axis for the model to be correctly oriented. The texture renders well, the model renders well, and all's well. I never had to open it in cmodview. Here are some screenshots with the 14k texture you had on this thread:
dionemodel1.PNG

dionemodel2.PNG

dionemodel3.PNG


I've packaged the model as a ready-made addon. It can be downloaded here: https://drive.google.com/open?id=0B5A59f3et_cJSGJTb1ZmUWJudmc

I've also attached the different version of the script:
export_cmod_plugin.zip
(4.68 KiB) Downloaded 248 times


FarGetaNik wrote:I have to reinstall python... well I was using pyhton 3 so maybe that's the reason I failed.
1. You don't have to reinstall Python...you can have both Python 2 and Python 3 installed at the same time. They use different directory folders.
2. I haven't tested the script with Python 3. All I know is that it works fine with Python 2.
Last edited by CM1215 on 10.09.2017, 18:14, edited 1 time in total.
CM1215: Celestial master in learning.


Return to “Modelling”