- Home /
Creating Mesh for DepthMask Shader
I'm having a bit of trouble with an effect I am trying to make. I want to have a second camera view inside the first camera that I can toggle. This is similar to the ShapeWipe (http://wiki.unity3d.com/index.php/ShapeWipe) expect instead of having the view shrink or grow to transition from one camera to another, I just want a constant sized circle that shows the second camera view inside the first. Here is the link to my original question with a bit more detail of the effect I'm going for, http://answers.unity3d.com/questions/389145/partial-texture-swapping-in-real-time.html.
I've taken a look at the code for ScreenWipe and ShapeWipe and it looks like I need to apply a depthmask shader to a mesh. However, I've never really used any shaders and I'm not sure how to create a circular mesh.
I found code to create a mesh from code at http://docs.unity3d.com/Documentation/ScriptReference/Mesh.html but I don't know what it wants for mesh.vertices, mesh.uv and mesh.triangles especially for a circle.
So any ideas how to create a circular mesh to use in a ScreenWipe type situation?
Thanks.
Answer by Eric5h5 · Feb 06, 2013 at 04:29 AM
Just make it in a 3D app. In Blender, it's Add->Mesh->Circle.
Ultimately this is the best answer but I didn't have access to any 3D modeling software at the time of this post. I needed a circular mesh to use in a script. Fortunately I was able to click on the little + icon next to the slot for the $$anonymous$$esh variable in script's inspector. I could select from available assets, including a default sphere which gave the desired effect once I scaled it.
Your answer
Follow this Question
Related Questions
What are normals? 1 Answer
Depth mask with alpha / adding alpha to frag grabpass shader 0 Answers
How to realize Unity Editor Scene Filter View Effect in my game. 0 Answers
GPU performance with tris and verts 1 Answer
My mesh didn’t appear in Unity 0 Answers