Drawing thin 3D lines with modern OpenGL - Reddit
文章推薦指數: 80 %
Drawing thin 3D lines with modern OpenGL. I'm a bit confused on how render thin 3D lines without using GL_LINES. Ideally I want to have a similar look to ... Foundtheinternet!r/openglPosts7Postedby8yearsagoDrawingthin3DlineswithmodernOpenGL I'mabitconfusedonhowrenderthin3DlineswithoutusingGL_LINES.IdeallyIwanttohaveasimilarlooktoBlendertostart.OnceIgettothatpointIthinkIunderstandhowtoimplementvaryingwidths,textures,shadereffects,etc.InBlendernomatterhowclose/farIgettoalineitalwaysappearstobe1pixelwide.ItsoundslikeIneedtocreatea2dquadandalignittothescreen?Istherea"safe"minimumwidthtouse?Iguessit'stheprojectionI'mhavingtroublewith.I'dliketoavoidanykindofgeometryshadersduetohardwaresupport.I'vebeengoingthroughthispaper/codebutI'mhopingasimpleexplanationmightkickmybrainintogear.11commentssharesavehidereport100%UpvotedSortby:best level1·8yr.agoWhydoyounotwanttouseGL_LINES?(sincerequestion,notasuggestiontouseit;Idon'tknow)6ReplyShareReportSaveFollowlevel2Op·8yr.agoIwantsomethingthatworksconsistentlyacrossvendorsandsomethingIhavemorecontroloverforthingslikeantialiasingorshadereffects.2ReplyShareReportSaveFollowlevel2·8yr.agoAMDchipstreatallGL_LINE_WIDTH'sas1...soit'snotreallythebestsupportedfeature.That'sthemainproblemI'mawareofwithGL_LINES(worksonNvidiacards).1ReplyShareReportSaveFollowContinuethisthread level2[deleted]·8yr.agoIdon'tthinkthefunctionisavailableonOpenGLES.It'sapain.0ReplyShareReportSaveFollowContinuethisthread level1·8yr.agoLineshavealwaysthesamewidthunlessyoudosomethingspecial.2ReplyShareReportSaveFollowlevel2Op·8yr.ago·edited8yr.agoIwanttodrawthemwithtriangles.2ReplyShareReportSaveFollowContinuethisthread level1·8yr.agoIlookedatthisforimplementation:http://www.codeproject.com/Articles/199525/Drawing-nearly-perfect-D-line-segments-in-OpenGL.I'veusedageometryshadertoreplacelineswithtrianglepairs,butIguessyoucanreplaceitinyourcodebygeneratingtherequiredtrianglesyourself.Youcanstoreanattributeforeachverticetohelpcalculatingthepositionfortherequiredwidth(youwanttobeinscreenspaceforcalculatingapixelswidth)2ReplyShareReportSaveFollowlevel1·8yr.agoI'vebeenquestioningthismyselflately,Ithinkyouhavetostorethetwopointsintoabufferobjectandsendittotheshaderstointerpolatefragmentsbetweenthem.Youcangetprettycreativewiththewayyouwouldrenderthefragmentinsidethefragshader.1ReplyShareReportSaveFollowAboutCommunityr/openglNews,informationanddiscussionaboutOpenGLdevelopment.20.9kMembers20OnlineCreatedJun6,2009JoinToppostsjuly17th2014Toppostsofjuly,2014Topposts2014BacktoTop Advertisement
延伸文章資訊
- 1Drawing thin 3D lines with modern OpenGL - Reddit
Drawing thin 3D lines with modern OpenGL. I'm a bit confused on how render thin 3D lines without ...
- 2OpenGL 101: Drawing primitives - points, lines and triangles
OpenGL 101: Drawing primitives - points, lines and triangles. Posted on May 13, 2013 by Paul. The...
- 3Hello Triangle - LearnOpenGL
In modern OpenGL we are required to define at least a vertex and fragment ... and back of all tri...
- 4Sample Modern OpenGL Programs - UCSD Math Department
SimpleDrawModern shows how to draw points, lines, line strips, line loops, and triangles. It incl...
- 5performance drop when drawing a line in OpenGL
There is no any function in modern OpenGL to draw a sphere using a simple one line command. You n...