Line Width - WebGL - Khronos Forums

文章推薦指數: 80 %
投票人數:10人

Hi, I find a function called "lineWidth". However, I cannot set the line width using this function. Since I think the drawn line is thin, ... LineWidth OtherStandards WebGL Phinehas January10,2011,2:47am #1 Hi, Ifindafunctioncalled"lineWidth".However,Icannotsetthelinewidthusingthisfunction.SinceIthinkthedrawnlineisthin,Iwanttomakeitthick.Isthereanymethodtomakethelinethick? SteveBaker January10,2011,11:44am #2 Youshouldcheckthegl.getforgettingthemaxlinewidth(Iforgetwhatthetokenisforthatrequest)-Ibetit’sreturningamaxwidthofonepixel-whichit’sallowedtodoaccordingtothespec.ThereasonbeingthatunderWindows,browsersoftenusethe“ANGLE”codewhichrunsWebGLontopofthenativeDirect3DlibraryratherthantheOpenGLimplementation.Direct3Ddoesn’tsupportanykindoflinewidthcontrol-hence,tobecompliant,italmostcertainlyreportsbackamaxlinewidthof1.0. Allofwhichisverywonderfulintheory-butinpractice,youstilldon’thavefatterlines. Intheend,you’veprettymuchgottadrawthemaspolygons-whichisapainintheasstogetright…andslowasallhellinJavaScript. Inanidealworld,theANGLEdriverwouldconvertlinestopolygonsforyou…buteventhatisvastlymoredifficultthanyoumightthinkbecauseyourvertexshadercodemightdosomethingtoscrewupthelinewidth. Basically,you’rescrewed!



請為這篇文章評分?