Page 1 of 1

spec-maps in cmods

Posted: 14.07.2011, 23:34
by fungun
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

Re: spec-maps in cmods

Posted: 15.07.2011, 04:07
by selden
"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.

Re: spec-maps in cmods

Posted: 24.07.2011, 05:04
by Reiko
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.

Re: spec-maps in cmods

Posted: 24.07.2011, 13:29
by selden
You can also set specular values in Anim8or's menu for that material.