I was excited to hear about the recent support for terrain materials' friction, particle effects, and depth on static meshes, but I can't seem to get it to work properly. Code: singleton Material(mesh_grass) { mapTo = "grass_1"; diffuseColor[0] = "0.98 0.98 0.98 2"; detailMap[0] = "levels/garfieldHeights/art/textures/overlay_grass_01B.png"; diffuseMap[0] = "levels/garfieldHeights/art/terrains/Grass-01-D"; specular[0] = "0.5 0.5 0.5 1"; specularPower[0] = "50"; translucentBlendOp = "None"; materialTag0 = "Miscellaneous"; vertColor[0] = "1"; detailScale[0] = "0.1 0.1"; groundType = "grass"; groundDepth = 0; }; In spite of adding a groundmodel type and depth value to the material (all that I thought was necessary), the material still possesses the friction, sound, and particles of asphalt.
East Coast USA's mesh grass material doesn't have quotes around it; this is a direct copy from an official map. At any rate, adding quotes doesn't fix the problem. Naming conventions, perhaps?
I tested it with indianapolis, i cant get it to work either. There was nothing in the console either. except i did mine like this Code: singleton Material(indy_inf_gravel_02_01_0) { mapTo = "indy_inf_gravel_02_01_0"; groundType = "sand"; groundDepth = 0.2; diffuseMap[0] = "indy_gravel_02_d.dds"; specularMap[0] = "indy_gravel_02_d.dds"; useAnisotropic[0] = "1"; castShadows = "0"; translucent = "0"; translucentZWrite = "1"; }; Like he said tho, is there something wrong here? there is no wiki about it yet so i dont really know where else to ask.
I'll make some documentation soon. Here's a test object we used to debug the whole thing. Extract on your map, and add it to your level.
Ah, I've got it. I'd been using a separate collision mesh the entire time, one devoid of any materials. Switching to visible mesh seems to be working. Thanks!
Ah, totally forgot to tell you to check that You can assign a material to your collision mesh by the way.
It's optional, like it was before. If you have a very complex mesh, you should use a simplified colmesh to save FPS. If you make a colmesh, you can assign a material to it (incase you want to assign a particoular groundmodel to it)
If i just remove the colmesh on indianapolis, and assign the materials, will it have collision? will it work? or is it a bit more complicated then that. Because the colmesh is not that different from the actual mesh of the track. so i dont think there should be that much of a difference.
You can use Collision Mesh (Mainly used when the visual mesh is very complex. A simplified collision mesh can greatly help FPS). Visual Mesh For your collisions. If you use the first, you will have to assign materials to the collision mesh if you plan to add different groundmodels to it. If you use the second, since it will already have materials, you don't have to do anything extra.
Ok, It sounds easy, but even the materials where i added a groundmodel does not have collision now. do i need a colmesh or can i just keep the normal imported mesh? Basically, what i did was delete the colmesh and just keep the visual mesh, i saved it like that and cleared the cache and restarted the game to make sure that everything reloaded properly. but there arent any collisions. do i need to add something extra like the colmesh has? or should i just be able to import a model and give it groundmodel for it to work?
You didn't set the visible mesh's collisionType to "Visible Mesh". I'd keep the collision mesh if I were you though... LODCOL.dae (The collision mesh you're using) has 42,670 tris. Highlodmap.dae (The visible mesh) has 202,954 tris. Massive difference.
Oh, thanks, i didnt know i had to do that. and surprisingly, there isnt much of a difference with the frames, nothing that i noticed as of now. Also, is there something that i would do to so that i dont go through the sand? Grass seems to slide a bit too much as well.
I read in another thread that "Depth will heavily affect grip." Add this to your material and play around with the value until you feel it's right. Code: groundDepth = 0.2;
Oh thats not the problem, the problem is that when i fall in a sandpit, the vehicle will go in the depth of it and then fall through the map.
I can drive in them just fine, even if I remove the LODCOL mesh and set Highlodmap's collisionType to "Visible Mesh". EDIT: Oh. I see what you mean now. I just set the groundDepth and am now falling through.
groundDepth is limited to 0.20. Values more or equal to that will mean you can go pass through the terrain.