Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 elenzil · Feb 27, 2016 at 11:51 PM · renderingcustomc++compute shaderlines

advice for computing and rendering many, many line segments ?

I'm thinking about a unity port of my iOS app "Prism HD".

The fundamental rendering task each frame is this:

  1. Compute a whole bunch of line segments to simulate optical effects. " many" = maybe 10,000 or so. each segment has x & y data plus a u & v texture coordinate. for what it's worth, the simulation is 2D, not 3D.

  2. Draw them.

so i have two questions:

  1. if C# turns out not to be fast enough to crunch 10,000 rays at 60Hz, would i be better off doing the math in C (that's how i do it in iOS), or should i learn how to use compute shaders ? I'm only interested in targeting iOS, Android, and maybe desktop, so i don't need it to work in WebGL. There's not a lot of computer shader examples w/ unity.

  2. how do I draw these things ? I'm super lazy. CommandBuffers seem pretty mesh-oriented, and this isn't a mesh. I'd prefer not to convert each line segment to a quad, because that quadruples the number of vertices which need to go over the bus. Again, is a shader the way ? I've never stepped outside of the fixed-function pipeline.

Comment
Add comment · Show 4
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 elenzil · Feb 28, 2016 at 01:13 AM 0
Share

hm, just discovered GL, that might be great.

avatar image elenzil elenzil · Feb 28, 2016 at 01:32 AM 0
Share

looks perfect, except you need to make a GL call for each vertex. ie you can't pass a VertexBuffer. otoh, 10,000 line segments render just fine in IDE and also in WebGL. if i could keep this all in C# that would be awesome.

avatar image Cherno · Feb 28, 2016 at 01:38 AM 0
Share

$$anonymous$$aybe take a look at Vectrosity on the Asset Store.

avatar image elenzil Cherno · Mar 02, 2016 at 12:32 AM 0
Share

hm, perhaps. thanks.

0 Replies

· Add your reply
  • Sort: 

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

38 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

Related Questions

Shader limits on iPad 1 Answer

GL.LINES renders in a single quadrant of the screen 0 Answers

Fine lines on assets shimmer/flicker while moving 1 Answer

Make custom input devices available to scripting via "Input" 2 Answers

,Drawing 100 000+ cubes 1 Answer


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