Hi community,
how to set transparent on particular single mesh object using the same material by multiple meshes?
Currently i am able to transparent by setting the diffusion alpha value of particular material,
however it will also make other objects transparent as well.
How do i control such that same material shared by multiple meshes could only allow transparency for particular mesh?
Thank you.
How to transparent 1 mesh using same material?
-
- Kobold
- Posts: 30
- Joined: Wed Nov 13, 2013 5:59 pm
- x 1
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: How to transparent 1 mesh using same material?
Use 2 materials, one transparent and one not.
-
- Kobold
- Posts: 30
- Joined: Wed Nov 13, 2013 5:59 pm
- x 1
Re: How to transparent 1 mesh using same material?
Hi thanks for reply,
do you mean cloning the material?
Because it is set by external file .material,
and i just use the createEntity(entityName, meshName) function to load the external .mesh file,
so it automatically look up for the .material file.
do you mean cloning the material?
Because it is set by external file .material,
and i just use the createEntity(entityName, meshName) function to load the external .mesh file,
so it automatically look up for the .material file.
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: How to transparent 1 mesh using same material?
You can either create 2 materials using scripts, or do it programmatically (eg. clone and set transparancy on the new material). Doesn't matter which. Then use Entity::setMaterial or setMaterialName to assign the material. It doesn't matter what material is hardcoded into the .mesh file, just override it after it loads.
-
- Kobold
- Posts: 30
- Joined: Wed Nov 13, 2013 5:59 pm
- x 1
Re: How to transparent 1 mesh using same material?
Thanks bro,
I will try it when i'm home today!
I will try it when i'm home today!