spec-maps in cmods

Have a question about using Celestia? Check here first for FAQs and helpful advice.
Forum rules
Please help to make this forum more useful by checking the FAQs before posting! Keep it clean, keep it civil, keep it truthful, stay on topic, be responsible, share your knowledge.
Topic author
fungun
Posts: 315
Joined: 30.07.2007
Age: 63
With us: 17 years 3 months
Location: Iowa, USA

spec-maps in cmods

Post #1by fungun » 14.07.2011, 23:34

I read at Selden's site that cmods support specular maps.
I aplly spec-maps to 3ds models in Anim8or, export to cmod, load them up in Celestia, and the spec-map doesn't load.
I checked the log (~) and it says everything loads but the spec-map.
Am I doing something wrong?

Partial example of one of the cmod files.

Code: Select all

# driveHull1 has 1 material(s)

material # 0

# diffuse  1 1 1
#  diffuse weight 0.7     # Kd
  diffuse 0.8 0.8 0.8
  opacity 1
  texture0      "enterprisehull1_glow.jpg"

# specular  0.898 0.898 0.898
#  specular weight 0.3     # Ks
  specular 0.269 0.269 0.269
  specpower 104     # (roughness)*2.55
  specularmap "enterprisehull1_specular.jpg"
#  emissive  1 1 1
#  emissive weight 0     # Ke
  emissive 0 0 0 # product
emissivemap "enterprisehull1_glowi.jpg"
end_material


Thanks,
Tim

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

Re: spec-maps in cmods

Post #2by selden » 15.07.2011, 04:07

"It works fine for me."

You show only the material section of the cmod ( driveHull1.cmod_material) . Hopefully you concatenated it with the section driveHull1.cmod_mesh to create driveHull1.cmod

Don't forget to put all the .jpg texture files in textures\medres so Celestia can find them.
Also, if you have an older graphics card, you'll need to ensure that all texture images are a power-of-two on a side.

To test, I created a sphere in Anim8or and applied diffuse and specular jpeg images to it.
Selden

Reiko
Posts: 1119
Joined: 05.10.2006
Age: 41
With us: 18 years 1 month
Location: Out there...

Re: spec-maps in cmods

Post #3by Reiko » 24.07.2011, 05:04

Secmaps work great but I found I had to add the line after the cmod was created.

Image

# driveHull1 has 1 material(s)

material # 0

# diffuse 1 1 1
# diffuse weight 0.7 # Kd
diffuse 0.9 0.9 0.9
opacity 1
texture0 "enterprisehull1_glow.jpg"

# specular 0 0 0
# specular weight 0 # Ks
specular 0.6 0.6 0.6
specpower 1.5 # (roughness)*2.55

specularmap "enterprisehull1_specular.jpg"
# emissive 1 1 1
# emissive weight 0 # Ke
emissive 0 0 0 # product
emissivemap "enterprisehull1_glowi.jpg"
end_material


When I tried it at first it appeared it wasn't working until I adjusted the specular and specpower.

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

Re: spec-maps in cmods

Post #4by selden » 24.07.2011, 13:29

You can also set specular values in Anim8or's menu for that material.
Selden


Return to “Help Central”