Skip to main content
10-Marble
April 8, 2025
Solved

Reset shader values of a model in Vuforia Studio

  • April 8, 2025
  • 1 reply
  • 916 views

Hello, I made a function that cuts my model based on the value of a slider, to obtain a dynamic section-like effect.
This model has some element which are glass-like (material wise) and when I apply the "cut" which is basicall a shader this "glass" becomes darker, more like plastic. I would like to know if there is a way to reset the model shader value to its default value.
The code for the section is the following:

 planarCutmodel.shader = `planar_cut; clipCenterX f ${$scope.clipCenterX}; clipCenterY f 0.0; clipCenterZ f 0.0; clipAxisX f 1.0; clipAxisY f 0.0; clipAxisZ f 0.0; clipLineWidth f 0.003`;
I tried with 
$scope.view.wdg["model-1"]['shader'] = undefined; or tml3dRenderer.setProperties('model-1', {'shader': undefined}); but nothing happens.
Thanks in advance
 




Best answer by RolandRaytchev

Hello @FC_12202090,

please try to set it to '' or to 'Default'

in preview seems that all both worked 

so example

$scope.unsetTest=function() {
 $scope.view.wdg['model-1'].shader='Default';
//or

$scope.view.wdg['modelItem-1'].shader='';
 $scope.view.wdg['modelItem-2'].shader=''
 $scope.$applyAsync();

 

 

1 reply

21-Topaz I
April 10, 2025

Hello @FC_12202090,

please try to set it to '' or to 'Default'

in preview seems that all both worked 

so example

$scope.unsetTest=function() {
 $scope.view.wdg['model-1'].shader='Default';
//or

$scope.view.wdg['modelItem-1'].shader='';
 $scope.view.wdg['modelItem-2'].shader=''
 $scope.$applyAsync();

 

 

10-Marble
April 10, 2025

Hello @RolandRaytchev yeah I've already fixed it but thank you very much