Jump to content

LoadMesh. Want to obtain different references to change materials independently


isidisi
 Share

Recommended Posts

I need to change materials of meshes dynamically(using PaintSurface) and I find the following problem:

 

If I load the same .gmf using LoadMesh 2 times, LoadMesh returns the same reference. Thus when change a material in first object with PaintSurface, also changes in the second.

 

Is there any way to load gmfs more than once and get diferent instances, to change the materials independently?

 

Thanks

Link to comment
Share on other sites

I'm not sure if changing the materials will be possible in Leadwerks3D, because it is not yet released. :blink:

 

In Leadwerks Engine 2 there is no way to change the material for a specific instance of a model. You

pretty much have to copy the .gmf file and rename it. That way it is the same model but you can use a

different material for it.

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

I'm not sure if changing the materials will be possible in Leadwerks3D, because it is not yet released. :blink:

 

In Leadwerks Engine 2 there is no way to change the material for a specific instance of a model. You

pretty much have to copy the .gmf file and rename it. That way it is the same model but you can use a

different material for it.

 

Yes I know this, but is not a clean solution. It will be better to add a parameter to LoadMesh function in a future version. Same with materials...

Link to comment
Share on other sites

LE3D will have that. Another solution for LE2 is to use a shader that lets you offset a giant texture that has the textures you want to use from a value in SetColor I believe. Here is the post and somewhere in here is the shader file you can try out.

 

http://www.leadwerks.com/werkspace/topic/607-non-instancing-copy-command/page__p__5296__hl__instancing__fromsearch__1#entry5296

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...