cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

iOS Shader Bug

AlexK
14-Alexandrite

iOS Shader Bug

Hi Community,

 

When I use a highlight shader on a semi transparent model item on my iPhone, the model item loses its transparency after the shader is changed back to normal. but it works in preview. See video of bug:

 

 

Thanks for your help!

 

Best wishes,

 

Alex

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AlexK ,

I think the described issue is a problem already described in the post ( https://community.ptc.com/t5/Vuforia-Studio/Toggling-of-Shaders-not-working/m-p/713237#M9399 ) and reported to PTC dev team. There is a workaround to use instead of Default  shader the "" to remove the shader form the modelItem. Something like this;

 

//set the properties of the TML 3D Renderer to highlight the selected item using a TML Text shader. "green" is the name of the script for the TML Text.
    var shader =(Math.random() < 0.5) ? "blue": "green";
    tml3dRenderer.setProperties(item, hilite === true ? { shader: shader, hidden: false, opacity: 0.9, phantom: false, decal: true }
                                                      : { shader: "", hidden: false, opacity: 1.0, phantom: false, decal: false });

 

Alternatively you can use for transparence other shaders    like xray , class or others which will have  visual effects like transparency .

I attached an example which  use 3 different shaders.  You need to click on component (where not modelItem are defined -the project js does not handle the modelitem widget and therefore a userpick on the both modelItems widgets does not have any effects) , where it  set randomly the green or blue shader /tml text definition. Also at the start the both modelItem widgets : modelItem-1 is    initialized with xref shader and modelItem-2 has opacity 0.5

Here I attached the project what I tested. Please, let me know if you have questions.

View solution in original post

1 REPLY 1

Hi @AlexK ,

I think the described issue is a problem already described in the post ( https://community.ptc.com/t5/Vuforia-Studio/Toggling-of-Shaders-not-working/m-p/713237#M9399 ) and reported to PTC dev team. There is a workaround to use instead of Default  shader the "" to remove the shader form the modelItem. Something like this;

 

//set the properties of the TML 3D Renderer to highlight the selected item using a TML Text shader. "green" is the name of the script for the TML Text.
    var shader =(Math.random() < 0.5) ? "blue": "green";
    tml3dRenderer.setProperties(item, hilite === true ? { shader: shader, hidden: false, opacity: 0.9, phantom: false, decal: true }
                                                      : { shader: "", hidden: false, opacity: 1.0, phantom: false, decal: false });

 

Alternatively you can use for transparence other shaders    like xray , class or others which will have  visual effects like transparency .

I attached an example which  use 3 different shaders.  You need to click on component (where not modelItem are defined -the project js does not handle the modelitem widget and therefore a userpick on the both modelItems widgets does not have any effects) , where it  set randomly the green or blue shader /tml text definition. Also at the start the both modelItem widgets : modelItem-1 is    initialized with xref shader and modelItem-2 has opacity 0.5

Here I attached the project what I tested. Please, let me know if you have questions.

Top Tags