How to draw a thick line in metal ? | Apple Developer Forums
文章推薦指數: 80 %
Why doesn't Apple offer line width control? It's too inconvenient. Metal ... Drawing lines either involves non-trivial shaders that interpolate SDFs or ... GlobalNavOpenMenu GlobalNavCloseMenu AppleDeveloper Search Cancel AppleDeveloper News Discover Design Develop Distribute Support Account Cancel Onlysearchwithin“” QuickLinks 5QuickLinks DeveloperForums Searchbykeywordsortags SubmitSearch Clearsearchquery AdditionalinformationaboutSearchbykeywordsortags SupportedSearches:KeywordsearchkeywordSingletag[iOS]MultipletagswithOR[iOS]OR[macOS]OR[Xcode]MultipletagswithAND[iOS][macOS][Xcode]Keywordsandtags[iOS][macOS]keywordUsernamesandprofilesuser:appleseed Post Profile ▲ Signin Createaccount Searchbykeywordsortags SubmitSearch Clearsearchquery AdditionalinformationaboutSearchbykeywordsortags SupportedSearches:KeywordsearchkeywordSingletag[iOS]MultipletagswithOR[iOS]OR[macOS]OR[Xcode]MultipletagswithAND[iOS][macOS][Xcode]Keywordsandtags[iOS][macOS]keywordUsernamesandprofilesuser:appleseed You’renowwatchingthisthreadandwillreceiveemailswhenthere’sactivity.Clickagaintostopwatchingorvisityourprofile/homepagetomanageyourwatchedthreads. You’vestoppedwatchingthisthreadandwillnolongerreceiveemailswhenthere’sactivity.Clickagaintostartwatching. Isthereanyhighefficiencywaytodothese?Imean,dont'tchangethestructureofthelinevertex.Whydoesn'tAppleofferlinewidthcontrol?It'stooinconvenient. Metal Upvotepostofcgwang Downvotepostofcgwang 4.6k views Posted by cgwang Copytoclipboard Sharethispost CopiedtoClipboard Reply AddaComment AppleRecommended Metal,beingalow-levelAPI,onlyofferswhatGPUsaredirectlycapableof.OpenGLofferswidelinesbyemulatingthemwithquadinasoftwarelayer.SuchsoftwareemulationisbeyondthescopeofwhatMetaltypicallyprovides. Posted by GraphicsandGamesEngineer Copytoclipboard Sharethispost CopiedtoClipboard Postnotyetmarkedassolved UpvotereplyofGraphicsandGamesEngineer DownvotereplyofGraphicsandGamesEngineer PostmarkedasAppleRecommended AddaComment Replies FurthermoreisthereaplantoaddthesefunctiontoMetal? Posted by cgwang Copytoclipboard Sharethispost CopiedtoClipboard Upvotereplyofcgwang Downvotereplyofcgwang AddaComment Metal,beingalow-levelAPI,onlyofferswhatGPUsaredirectlycapableof.OpenGLofferswidelinesbyemulatingthemwithquadinasoftwarelayer.SuchsoftwareemulationisbeyondthescopeofwhatMetaltypicallyprovides. Posted by GraphicsandGamesEngineer Copytoclipboard Sharethispost CopiedtoClipboard Postnotyetmarkedassolved UpvotereplyofGraphicsandGamesEngineer DownvotereplyofGraphicsandGamesEngineer PostmarkedasAppleRecommended AddaComment ”Typicallyyousay?“InthatcaseIthinkthisshouldbeoneoftheexceptions.Thethingis,SceneKitsupportsthelineprimitiveandMetalsupportsthelineandthelinestripprimitives,yetat1pxwideonaretinadisplayitisbarelyvisible.Withoutameanstosetthewidth,theiruseisverylimited.SinceMetaldoesnotincludesupportforageometryshader,thewayto“emulatethemwithquadinasoftwarelayer”foruswouldbetoditchthelineprimitiveandusetrianglestripsorpolygonprimitiveinstead,whichinturnaddscpuandmemoryoverheadand“renders”thelineprimitivepointlessforanythingexcept1pxwidelines.Soaddingsupportforlinesshouldincludeanoptiontosetlinethicknesseitherdirectlythroughapropertyorindirectlythroughageometryshader. Posted by Xartec Copytoclipboard Sharethispost CopiedtoClipboard UpvotereplyofXartec DownvotereplyofXartec AddaComment Isthereanyapplicationatallforsinglepixellinesinrealworldapplications?Whywasteanysiliconatallonthis?Withoutlinethicknesstodosomethinglikedrawingawireframeovermyobjectsorusingtheoldstenciltrickforoutliningobjects,Ihavetomaintain2versionsofmygeometry,whichisinefficientandcumbersome. Posted by cocheret Copytoclipboard Sharethispost CopiedtoClipboard Upvotereplyofcocheret Downvotereplyofcocheret AddaComment +1Thisisveryfrustratingandseemslikethesortofbasicfunctionalityonewouldexpectfromanyrobust3DAPI. Posted by iwoj Copytoclipboard Sharethispost CopiedtoClipboard Upvotereplyofiwoj Downvotereplyofiwoj AddaComment HardwaredoesnotsupportdrawingthicklinesandsothisfunctionalityhasnobusinessinbeinginaGPUAPI.Nottomentionthattherearealotofchoicesthathavetobedone(howtohandlelinecaps,howtohandlealiasingetc.).Iamsurprisedthatsomepeoplethinkthisisbasicfunctionality,itclearlyisnot.Drawinglineseitherinvolvesnon-trivialshadersthatinterpolateSDFsorconstructinggeometryonthefly.Thiscouldbeataskforanauxiliarylibrary,butdefinitelynotforthecoreAPI. Posted by jcookie Copytoclipboard Sharethispost CopiedtoClipboard Upvotereplyofjcookie Downvotereplyofjcookie AddaComment
延伸文章資訊
- 1Metal by Tutorials, Chapter 3: The Rendering Pipeline
To draw on the screen at this point, you need only the vertices and the slopes they determine. Th...
- 2iOS Metal line width - Stack Overflow
If you are drawing multiple lines, multiply your instanceCount by the thickness you want and adju...
- 3Line Drawing Cartoon Metal Trumpet 库存矢量图(免版税 ...
在Shutterstock 收藏中查找Line Drawing Cartoon Metal Trumpet 张高清库存图片和其余几百万张免版税库存照片、插图和矢量图。 每天添加几千张全新的高品质图片。
- 4How to draw a thick line in metal ? | Apple Developer Forums
Why doesn't Apple offer line width control? It's too inconvenient. Metal ... Drawing lines either...
- 5bialylis/ThickRedLine: Thick Red Line - GitHub
ThickRedLine. Thick Red Line - drawing thick lines with constant on-screen width independent of p...