Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Yasar_Zhang · Aug 02, 2017 at 06:37 AM · geometry shader

the input value for geometryshader

I'm trying to write a shader to get the wireframe without diagonal of model . I use lineadj as the value for input and hope to get four point to check it is a diagonal or not. However the point p[3](the fourth point) is always zero and when i draw it in my screen ,it stays at the center of my screen. Is the point data is right or I get some wrong code in my shader [maxvertexcount(12)] void geom(lineadj v2g p[4], inout LineStream<g2f> lineStream) { // float4x4 vp = UnityObjectToClipPos(unity_WorldToObject); float4 pos0 = mul(unity_ObjectToWorld, p[0].pos); float4 pos1 = mul(unity_ObjectToWorld, p[1].pos); float4 pos2 = mul(unity_ObjectToWorld ,p[2].pos); float4 pos3 = mul(unity_ObjectToWorld ,p[3].pos); g2f pIn0; pIn0.pos =mul(UNITY_MATRIX_VP, pos0); pIn0.col = float4(0,0,0,1); g2f pIn1; pIn1.pos = mul(UNITY_MATRIX_VP, pos1); pIn1.col = float4(1,0,0,1); g2f pIn2; pIn2.pos = mul(UNITY_MATRIX_VP, pos2)}; pIn2.col = float4(0,1,0,1); g2f pIn3; pIn3.pos = mul(UNITY_MATRIX_VP, pos3); pIn3.col = float4(0,0,1,1); lineStream.Append(pIn0); lineStream.Append(pIn2); lineStream.RestartStrip(); lineStream.Append(pIn1); lineStream.Append(pIn2); lineStream.RestartStrip(); lineStream.Append(pIn0); lineStream.Append(pIn3); lineStream.RestartStrip(); }

alt text

1.jpg (124.7 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
0

Answer by The-White-Guardian · Apr 23, 2021 at 02:58 PM

Four years late, might as well add an answer. The problem isn't really your code, I'm getting the same issue, lineadj isn't working properly.

And that's because the team at Unity never implemented functionality for it. We're sadly not the only people getting this issue.

Comment
Add comment · 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

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

68 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

iPhone 6 plus Geometry Shader 0 Answers

Getting triangle center in fragment shader 1 Answer

(Bilboard Shader) Max Screen Size 0 Answers

Is there a way to get an id of the primitive in a geometry shader? 1 Answer

Are there any good resources for Geometry shaders out there? 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