Author Topic: Object Help: Placing Material on Meshes  (Read 1425 times)

Offline MistWolf

  • Curious Wanderer
  • *
  • Posts: 49
  • Floof-O-Meter: 3
    • View Profile
Object Help: Placing Material on Meshes
« on: February 23, 2015, 02:08:02 am »
I've downloaded a material which, when placed onto a basic cube mesh, is supposed to look like ice. However, the basic cube I have downloaded in my objects seems to be attached to a rock material, and whenever I try and change the material file in the Object Maker to the ice file, it tells me the file cannot be found. How can I get the mesh to accept the new material? Am I going to have to download a new basic cube, or can I change the file type somehow?

Offline Redlinelies

  • The FeralHeart Guru
  • Immortal Legend
  • *****
  • Posts: 7,077
  • Country: 00
  • Floof-O-Meter: 792
  • Modoru Pride
    • redlinelies
    • redlinelies
    • redlinelies
    • redlinelies
    • View Profile
Re: Object Help: Placing Material on Meshes
« Reply #1 on: February 23, 2015, 03:49:35 am »
The game will find any .material file inside of the game that lays within the folders added to resources.cfg as far as I'm concerned. So with other words, if you place your .material file inside of my_objects folder where it should be, and then try to add your ice material to a mesh from within the game it will work.

Do keep in mind though that in order to add your own material to a mesh the coding for such material within your .material file must be written correctly, but you must also give the correct name for the material in the game which is not the name of the file, rather the name you give the material in the coding.

Something like "IceMat" all depending on what you name that line, I also do believe it's case sensitive so if you write IceMat it cannot be icemat, then the game object maker will not find it.

Look at the line for the texture in the crystal.material that comes with the game:

Code: [Select]
material crystalMat
{
technique
{
pass
{
cull_hardware none
cull_software none
emissive 1 1 1
texture_unit
{
env_map spherical
texture crystalTex.jpg
}
}
}

So if you were to add the crystal material onto any object, you'd need to give the game "crystalMat" as your material. Hopefully this is correct since I haven't diddled around with it in some time now.
Former community manager of FeralHeart

Offline MistWolf

  • Curious Wanderer
  • *
  • Posts: 49
  • Floof-O-Meter: 3
    • View Profile
Re: Object Help: Placing Material on Meshes
« Reply #2 on: February 23, 2015, 03:46:33 pm »
The game will find any .material file inside of the game that lays within the folders added to resources.cfg as far as I'm concerned. So with other words, if you place your .material file inside of my_objects folder where it should be, and then try to add your ice material to a mesh from within the game it will work.

Do keep in mind though that in order to add your own material to a mesh the coding for such material within your .material file must be written correctly, but you must also give the correct name for the material in the game which is not the name of the file, rather the name you give the material in the coding.

Something like "IceMat" all depending on what you name that line, I also do believe it's case sensitive so if you write IceMat it cannot be icemat, then the game object maker will not find it.

Look at the line for the texture in the crystal.material that comes with the game:

Code: [Select]
material crystalMat
{
technique
{
pass
{
cull_hardware none
cull_software none
emissive 1 1 1
texture_unit
{
env_map spherical
texture crystalTex.jpg
}
}
}

So if you were to add the crystal material onto any object, you'd need to give the game "crystalMat" as your material. Hopefully this is correct since I haven't diddled around with it in some time now.

Thank you so much! That was what I was doing, I wasn't typing in the material file correctly. Now I've gotten it to work just fine. Thank you so much, Red!