Compiling the CMOD tools on a non-Windows platform

The place to discuss creating, porting and modifying Celestia's source code.
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Compiling the CMOD tools on a non-Windows platform

Post #21by chris » 18.09.2009, 19:31

Fridger: thanks for posting your build steps.

Another project for the next major Celestia release: modularize the cmod code so that it's independent of the rest of Celestia. We shouldn't have to link in a huge chunk of Celestia just to build an app like cmodfix that reads and writes cmod files.

--Chris

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Compiling the CMOD tools on a non-Windows platform

Post #22by chris » 18.09.2009, 19:32

cartrite wrote:Right after I built cmodfix, I tried to build 3dstocmod. That still needs some Eigen conversions. Got a few build errors. It builds great on 1.6.1. I wanted to build that last week when I was playing around with that Blender export script. Seems that specpower is being exported with 3dstocmod. Just seen that. But I can't figure out what Material variable to use with Blender to get specpower to be exported. I can export diffuse and specular color but specpower???????

It might be called something like 'shininess' or 'specular exponent.'

--Chris

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Compiling the CMOD tools on a non-Windows platform

Post #23by t00fri » 18.09.2009, 19:37

cartrite wrote:Right after I built cmodfix, I tried to build 3dstocmod. That still needs some Eigen conversions. Got a few build errors. It builds great on 1.6.1. I wanted to build that last week when I was playing around with that Blender export script. Seems that specpower is being exported with 3dstocmod. Just seen that. But I can't figure out what Material variable to use with Blender to get specpower to be exported. I can export diffuse and specular color but specpower???????
cartrite

That's right 3dstocmod needs Eigen conversion.
The error is

Code: Select all

3dstocmod.cpp:113: error: conversion from ‘Eigen::Vector3f’ to non-scalar type ‘Point3<float>’ requested
3dstocmod.cpp:114: error: conversion from ‘Eigen::Vector3f’ to non-scalar type ‘Point3<float>’ requested
3dstocmod.cpp:115: error: conversion from ‘Eigen::Vector3f’ to non-scalar type ‘Point3<float>’ requested
3dstocmod.cpp:204: error: conversion from ‘Eigen::Vector3f’ to non-scalar type ‘Point3<float>’ requested
3dstocmod.cpp:216: error: cannot resolve overloaded function ‘x’ based on conversion to type ‘float’
3dstocmod.cpp:217: error: cannot resolve overloaded function ‘y’ based on conversion to type ‘float’


There are more trivial bugs in the other tools.

like #include <io.h> in cmodsphere.cp . Just comment it out!

and also in txt2cmod.cpp I get an error that exit() is not defined, but only for gcc 4.3.2 of OpenSuSE 11.1. For 10.3 it works fine. The error goes away if #include <stdlib.h> is included, but there is surely a better way.

EDIT: instead of stdlib.h of course the C++ variant <cstdlib> should be included. I checked, this works under gcc 4.3.2

It's all pretty simple to get rid of.

++++++++++++++
With these simple mods, cmodfix, cmodsphere, cmodtangent, txt2cmod all build fine under OpenSuSE 11.1 with gcc 4.3.2
++++++++++++++

Fridger
Last edited by t00fri on 18.09.2009, 20:23, edited 2 times in total.
Image

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Compiling the CMOD tools on a non-Windows platform

Post #24by t00fri » 18.09.2009, 19:38

chris wrote:Fridger: thanks for posting your build steps.

Another project for the next major Celestia release: modularize the cmod code so that it's independent of the rest of Celestia. We shouldn't have to link in a huge chunk of Celestia just to build an app like cmodfix that reads and writes cmod files.

--Chris

Absolutely!

F.
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #25by cartrite » 18.09.2009, 19:56

Gcc has been moving headers around with every new release. On the gcc 4.3 porting to page, there is mention of the "exit" problem in a section "If missing". They actually say to use #include <cstdlib>.
http://gcc.gnu.org/gcc-4.3/porting_to.html

xtocmod seems to be a mess. Is that for windows or something?
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Compiling the CMOD tools on a non-Windows platform

Post #26by t00fri » 18.09.2009, 20:01

cartrite wrote:Gcc has been moving headers around with every new release. On the gcc 4.3 porting to page, there is mention of the "exit" problem in a section "If missing". They actually say to use #include <cstdlib>.
http://gcc.gnu.org/gcc-4.3/porting_to.html

xtocmod seems to be a mess. Is that for windows or something?
cartrite

Yes that's what I meant: <cstdlib> is the C++ variant of <stdlib.h> . That's the right one.

Yes xtocmod only compiles under windows as Chris explains in the readme.

F.
Image

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Compiling the CMOD tools on a non-Windows platform

Post #27by t00fri » 18.09.2009, 20:11

Steve,

It's actually quite funny: I am remotely controlling my new office computer from home to both compile for OpenSuse 11.1 and Windows/CUDA interchangeably.

For that I invented a cute alternate boot sequence with grub. Without going to details, by simply running under Linux

grub-set-default 2
reboot

I reboot just ONCE to Windows by default. The Windows desktop I perfectly control (without any delays and in excellent quality) by means of the TightVNC Server/ Viewer pair along with a VPN tunnelling socket set up via ssh in putty (Windows). With MS RemoteDesktop, CUDA doesn't work remotely as you can follow in detail in the CUDA forum. TightVNC works perfectly, though.

Then, if I need to check e.g. cmodfix under OpenSuSE 11.1, I quickly reboot (remotely) and end up automatically again with Linux ;-) and so on.

F.
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #28by cartrite » 18.09.2009, 20:15

chris wrote:
cartrite wrote:Right after I built cmodfix, I tried to build 3dstocmod. That still needs some Eigen conversions. Got a few build errors. It builds great on 1.6.1. I wanted to build that last week when I was playing around with that Blender export script. Seems that specpower is being exported with 3dstocmod. Just seen that. But I can't figure out what Material variable to use with Blender to get specpower to be exported. I can export diffuse and specular color but specpower???????

It might be called something like 'shininess' or 'specular exponent.'

--Chris
These are my options as far as I can tell.

Code: Select all

spec
Degree of specularity. Value is clamped to the range [0.0,2.0].

Type:
    float

Code: Select all

specSize
Material's specular area size ("Toon" specular shader only). Value is clamped to the range [0.0,1.53].

Type:
    float


Code: Select all

specSmooth
Sets the smoothness of specular toon area. Value is clamped to the range [0.0,1.0].

Type:
    float


Code: Select all

specTransp
Makes specular areas opaque on transparent materials. Value is clamped to the range [0.0,1.0].

Type:
    float

I was thinking of trying specTransp but I don't think that is what specpower is all about.

I actually use spec already. It is multiplied by specCol. For example.

Code: Select all

spec_r = (mat.spec*mat.specCol[0])

In what I seen so far, this value has been .5. So this reduces the specular color from 1.0 to 0.5. Maybe I should use

Code: Select all

spec_r = (mat.specCol[0])
and use something like

Code: Select all

if mat.spec:
          spec_pwr = mat.spec
......
out.write('specpower %f\n' % (spec_pwr))

Is spec power a multiplication of the specular color? From what I seen in the way it works with planets, the smaller the specpower number, the less specular highlights but larger coverage area.
cartrite
Last edited by cartrite on 18.09.2009, 20:24, edited 1 time in total.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #29by cartrite » 18.09.2009, 20:20

I reboot just ONCE to Windows by default..............Then, if I need to check e.g. cmodfix under OpenSuSE 11.1, I quickly reboot (remotely)
Fridger,
That sound pretty cool.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: Compiling the CMOD tools on a non-Windows platform

Post #30by t00fri » 18.09.2009, 20:27

cartrite wrote:
I reboot just ONCE to Windows by default..............Then, if I need to check e.g. cmodfix under OpenSuSE 11.1, I quickly reboot (remotely)
Fridger,
That sound pretty cool.
cartrite

It IS cool ;-) . Also it's so convenient and fast to have the fullscreen Windows desktop over here and use that remote computer like it was on the table next to me. I can even run Celestia remotely and read off the REALISTIC fps values on my local screen ;-) . Or I can compute without significant delay with the standard VC++2008 IDE etc. from home. With my new E8400/4GB CPU it takes less than 2 minutes(!) for a complete rebuild of Celestia with the VC++2008Express IDE or with Qt-Creator for the Qt version.

About the pleasures of using CUDA 2.3/ nvtt.lib with my F-TexTools I'll report soon in more detail over in CM. With the highest quality DXT3 compression algorithm (nvtt.lib), it just takes 0.3 sec per 1k x 1k tile, while without CUDA acceleration it takes 18-25 sec for a single tile with this quality level!!!

So 2048 tiles (full level5) only require a remote run of 10 minutes.

F.
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #31by cartrite » 18.09.2009, 22:39

chris wrote:
It might be called something like 'shininess' or 'specular exponent.'

--Chris
It was called "hard". As in mat.hard
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #32by cartrite » 19.09.2009, 11:27

I'm wondering if "hard" is correct. Chris, see this quote from Blender docs.
CookTorr - This was Blender's only Specular Shader up to version 2.27. Indeed, up to that version it was not possible to separately set diffuse and specular shaders and there was just one plain material implementation. Besides the two standard parameters this shader uses a third, hardness, which regulates the width of the specular highlights. The lower the hardness, the wider the highlights.
and
hard
Hardness of the specularity. Value is clamped to the range [1,511].
Type:
int
Now this slider controls the width of the specular highlight on a globe in a preview window and it seems to act like specpower does. I'm hoping that this is correct.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

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

Re: Compiling the CMOD tools on a non-Windows platform

Post #33by John Van Vliet » 21.09.2009, 20:23

--- edit ---
Last edited by John Van Vliet on 21.10.2013, 01:22, edited 1 time in total.

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Re: Compiling the CMOD tools on a non-Windows platform

Post #34by cartrite » 22.09.2009, 01:21

John,
You must be talking about SVN. You can build the tools in 1.6.0 or 1.6.1 without the Eigen errors in 3dstocmod. In the SVN version, cmodfix built ok but I got Eigen errors building 3dstocmod.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4


Return to “Development”