Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by AmoralAckbar · Jun 09, 2013 at 01:30 PM · meshprocedural generationartifacts

Procedurally generated mesh half "see through"

Okay, so I am procedurally generating meshes in code. In this case, I have a 255x255 mesh that gets a procedural texture applied to it and the heights are defined by real geo data I am importing. Everything is working great except for some visual artifacts that I am getting when viewing the mesh from one side.

As you can see in the picture, when looking at the mesh from one side I can see through it all the way to the far off peaks. As I rotate around the mesh, this corrects itself along this weird jagged line that I captured in the image. The right side of the image is "correct" and the left side is "see through".

I am guessing that this has something to do with the winding order of my mesh generation or perhaps the normals? Has anyone built their own meshes in code and has an idea? One thing to note, I am texturing the mesh from both sides (top and bottom) as I want to be able to go "below" the terrain and look at it from the bottom.

alt text

unityartifact.png (130.8 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Owen-Reynolds · Jun 09, 2013 at 02:41 PM

Most shaders assume you want only a 1-sided mesh. To get 2-sided viewing, change it to Cull Off. Download the Unity Default shaders, grab whichever you're using and add/change the line.

Winding does tell the shader front vs. back face, and that probably is causing the problem. But if you need 2-sided, that won't matter anyway, so no point fixing it.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AmoralAckbar · Jun 09, 2013 at 03:36 PM 0
Share

I was already using Particles/Alpha Blended which has Cull Off in the shader. That is how I got 2 sided viewing working as is.

avatar image Owen-Reynolds · Jun 09, 2013 at 04:28 PM 0
Share

The particle shaders I$$anonymous$$HO, have a lot extra going on. A hidden "lifetime" color gradient, which is probably adding the transparency, and messing up the color. I'm thinking they also ignore normals. Then transparency always has depth issues.

If it was me, I'd want to test with the most boring Diffuse shader, then again with cull off.

avatar image AmoralAckbar · Jun 09, 2013 at 05:29 PM 0
Share

Got it working. I switched over to using a transparent cutout shader (I needed some fully transparent sections) and then turned culling off. Also, I had my winding backwards so I fixed that for the heck of it even though I am not culling.

Thanks for the help!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Voxel Mesh has Lines Between the Voxels 1 Answer

Do i have to use shared vertices if i want my proceduraly generated mesh to look smooth? 1 Answer

Artifacts / Stretch Marks in Mesh Manipulation 0 Answers

Generating spherical terrain from a spherical heightmap 1 Answer

Procedural mesh with texture atlas, how to get rid of material artifacts? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges