Brutile Posted May 21, 2014 Share Posted May 21, 2014 You know how in the editor, you can create a shape, add a material, then select a face and add a different material to it? How would I do that using code? I know I can create multiple surfaces in a model, but then you dont have the entire mesh to set as the collision shape and things get messy. Basically, I want to know how to create a mesh with multiple materials and set the whole mesh as the collider for the model. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 21, 2014 Share Posted May 21, 2014 You can set material per surface http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/surface/surfacesetmaterial-r214 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Brutile Posted May 21, 2014 Author Share Posted May 21, 2014 I know that much. The problem with doing things that way is (as far as I know) you can only set a single surface as the shape/collider for that model. Other engines use sub-meshes where you have one main mesh, then add triangles with an ID that have different materials. I just want to know what goes on when you do this in the editor, so I can do it in-game. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 21, 2014 Share Posted May 21, 2014 So are you saying you want to set materials on shapes? You don't generally do that as shapes are generally just used for collision which is invisible. Curious as to why are you wanting to do this? Quote Link to comment Share on other sites More sharing options...
Brutile Posted May 21, 2014 Author Share Posted May 21, 2014 No, not on the shape, on the mesh/surface. You can create multiple surfaces for one model, but you can only set one of those surfaces as the shape for the model. I'd like to be able to create just one surface that has multiple materials. Or alternatively, somehow add a combination of all the surfaces in a model as the shape. I can see where the confusion is... When I said shape, I meant a shape, like level geometry, eg cube, cylinder, etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.