How to hide shape behind objects

Avatar
  • updated

Hi, i would like to not see this cone behind my sphere but i don't know how to do that : 

Any idea ?

Image 712

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
richard

If the cone and the sphere are drawn with Shapes you can take a look at this section in the documentation.

If one of the Object is not a Shapes object you can use the Draw.ZTest property. It has different possible settings:
(Draw.ZTest = CompareFunction.LessEqualDraw.ZTest = CompareFunction.Always, ...).

Avatar
hugo lammens
Quote from richard

If the cone and the sphere are drawn with Shapes you can take a look at this section in the documentation.

If one of the Object is not a Shapes object you can use the Draw.ZTest property. It has different possible settings:
(Draw.ZTest = CompareFunction.LessEqualDraw.ZTest = CompareFunction.Always, ...).

Ok thanks for this, i will look at it, i have another question , do you know how we can play with  color mask  parameter, i want to disable the green part : 

Image 721

Avatar
richard

I have no experience yet witch the Color Mask parameters. However I found something in the Unity documentation after a quick search. It mentions the color channel parameters and some example code.
Maybe this helps.

Avatar
hugo lammens
Quote from richard

I have no experience yet witch the Color Mask parameters. However I found something in the Unity documentation after a quick search. It mentions the color channel parameters and some example code.
Maybe this helps.

It 's a shape parameter, not a unity one.

Avatar
hugo lammens
Quote from hugo lammens

It 's a shape parameter, not a unity one.

I have this function, i think i have to use it but i don't know how : 

Image 723

It's not working : 

Image 724

Avatar
richard
Quote from hugo lammens

I have this function, i think i have to use it but i don't know how : 

Image 723

It's not working : 

Image 724

I see.
If its an enum you have to assign it to something. If you want to leave out only the Green part you can do something like bitwise OR:

YourShapesProperty = ColorWriteMask.Alpha | ColorWriteMask.Blue | ColorWriteMask.Red;
Avatar
hugo lammens
Quote from richard

I see.
If its an enum you have to assign it to something. If you want to leave out only the Green part you can do something like bitwise OR:

YourShapesProperty = ColorWriteMask.Alpha | ColorWriteMask.Blue | ColorWriteMask.Red;

Oh ok, i see , but what is 'YourShapesProperty', is there any way to have an access to this ?

Avatar
hugo lammens
Quote from hugo lammens

Oh ok, i see , but what is 'YourShapesProperty', is there any way to have an access to this ?

Because i want to change it for my cone component which is  defined like that : private Cone cone;

Image 725

Avatar
hugo lammens
Quote from hugo lammens

Because i want to change it for my cone component which is  defined like that : private Cone cone;

Image 725

Ok i found it, thanks for this.

Avatar
richard

Great.
Can you share the solution?

Avatar
hugo lammens
Quote from richard

Great.
Can you share the solution?

Yep, there is the solution :

Image 727

Avatar
richard

Ah I see. Thanks for sharing :).