![]()  | 
	
		
 Applying mask using Stencil Function 
		
		
		Hello Friends! 
	I am using Stencil Function to apply and remove the masked portion of an object. before applying the mask my objects are looking like this: http://i438.photobucket.com/albums/q.../Clipping1.jpg The front object is logo2, the back object is logo1 & in between object is named masked & it'll be used for masking. Simple code for viewing this in your vizard is: Code: 
	import vizCode: 
	import vizhttp://i438.photobucket.com/albums/q.../Clipping2.jpg Now here you'll notice that both the front and back objects are affected by mask. What we want is only back object should get affected and not the front one. But the function will be applied on both the objects as they keep on rotating in our application so many times the front object will go back side of the mask and that time the mask has to clip that object. Wondering if there is any function viz.StencilFunc.RenderBacksideMask() or viz.StencilFunc.RenderBehindMask()! Can you please suggest me where am I going wrong? Is there any way to do this by using shaders?  | 
		
 No need to use stencil function. We just have to use mask.disable(viz.COLOR_WRITE) this command will not display the object but it'll still write to depth. So the object behind this invisible object will get affected. Don't forget to set mask.drawOrder(-1).  
	Code: Code: 
	import vizNow don't worry about the black mask. if you set the environment scene i.e. piazza draw order lower than mask draw order then piazza will get rendered before mask. add this line to the previous code Code: 
	piazza.drawOrder(-2)http://i438.photobucket.com/albums/q.../Clipping4.jpg  | 
| All times are GMT -7. The time now is 02:31 AM. | 
	Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
	
	Copyright 2002-2023 WorldViz LLC