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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Translate the entire conversation x

Inbuilt Shader

Aditya1702
16-Pearl

Inbuilt Shader

Hi Everyone,

Good Morning,

 

Can anyone help me out in how to use inbuilt planar cut and flow shader which has been recently introduce in Vuforia Studio 9.25.6.0.

 

Thanks in advance.

 

Regards,

Aditya Gupta

3 REPLIES 3

Hi @VladimirN ,

 

Thank you for your response.

 

I tried but was not able to deploy the planar cut, I am not aware how to bring the plane as shown in the below video link.

 

https://www.linkedin.com/posts/danielfonai_ar-vuforia-vuforiastudio-activity-7310558207528083457-FcTs?utm_source=share&utm_medium=member_desktop&rcm=ACoAACOBZqUBtf_e1HQokiPvTyeKCLb0h8BeP2U

 

Also, had one more doubt does the flow shader requires uv mapped cad model?

 

Thnaks & Best Regards,

Aditya Gupta

Hi @Aditya1702 ,

regarding your question for the planer shader according to https://support.ptc.com/help/vuforia/studio/en/#page/Studio_Help_Center%2FModelShaders.html

-> required is the center of the cut plane and a normal vector which defines the direction /normal to the cut plane.

Example of  js code which will set at begin the shader and then on change of the slider will move the position of the plane e.g along x:

$scope.init = function() {
  $scope.app.planarCutModel=$scope.view.wdg['model-1'];
  $scope.app.planar_cut_str = 'planar_cut; clipCenterX f '+$scope.app.params.clipCenterX+
                                                          '; clipCenterY f ' +$scope.app.params.clipCenterY+
                                                          '; clipCenterZ f ' +$scope.app.params.clipCenterZ+
                                                          '; clipAxisX f '+$scope.app.params.clipAxisX+
    													  '; clipAxisY f '+$scope.app.params.clipAxisY+
    													  '; clipAxisZ f '+$scope.app.params.clipAxisZ+
    													  '; clipLineWidth f '+$scope.app.params.clipLineWidth+';';

 
  $scope.app.planarCutModel.shader =  $scope.app.planar_cut_str;
  $scope.$applyAsync();
};

angular.element(window.document.body).ready($scope.init);
//===========================
$scope.app.updateShaders=()=>{

$scope.app.planar_cut_str = 'planar_cut; clipCenterX f '+$scope.app.params.clipCenterX+
                                                          '; clipCenterY f ' +$scope.app.params.clipCenterY+
                                                          '; clipCenterZ f ' +$scope.app.params.clipCenterZ+
                                                          '; clipAxisX f '+$scope.app.params.clipAxisX+
    													  '; clipAxisY f '+$scope.app.params.clipAxisY+
    													  '; clipAxisZ f '+$scope.app.params.clipAxisZ+
    													  '; clipLineWidth f '+$scope.app.params.clipLineWidth+';';
  $scope.app.planarCutModel.shader = $scope.app.planar_cut_str;
  $scope.$applyAsync();

}

here I used parameter which I could bind to the widget value - e.g. the clipCenerX with the slider 2d widget. There to fit the value some filter in the slider binding like that:

2025-04-01_10-26-59.jpg

So the clipLineWith is the with of the white clipLine 

2025-04-01_10-30-18.jpg

So far I know it does not require UV mapping. Mostly shaders which use a texture will require such UV mapping to map the texture correctly . Here it calculates only the values of the cut surface.

sample project attached

Announcements
Top Tags