Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hexc11266yGl line width is deprecated, you should use a proper quad mesh.
Then just stretch it out for the length/width of the line
Edit: I should also mention quads are not supported so you need to make the quad out of 2 triangles. 😜 -
nnee4696yThis seems to fit perfectly in overall web development and standards. You have to love consistency.
-
It's old deprecated functionality and for good reason, there's no reason why a modern graphics card would need hardware to draw a thick line when polygon processing is fast enough that you can just use two tris instead.
Actually, a lot of the more 2D parts of the OpenGL standard are going out of scope, reflecting trends in the graphics hardware industry. When you use OpenGL you're also using a lot of historical baggage, this is one big reason why Vulkan was made. -
Byomeer22096y@hexc @RememberMe Actually i use lines to draw bounding box wire frames so a width of 1px is okay for now... but still.
I don't think there's a need to erase this handy feature, especially if you have to upload much more vertex data in order to render a quad. For debugging purposes, i want the smallest possible bandwidth - 3 times the data per drawn line is not really a good option.
Besides that it's a great example for downward compatibility (setting limits to 1 instead of just erasing the function) and a beautifully crafted sentence by some MDN member to describe the deprecation =D -
LuxARTS16636yNeed more width?
for(uint16_t i=0;i<WIDTH;i++)
drawHorizontalLine(x, y+i, length);
//Same for vertical lines
(For those who didn't caught it: It's a joke) -
Byomeer22096y@LuxARTS Perfect! Then i force my userbase to buy nVidia's new RTX cards and utilize the higher ray drawing performance by casting 2D rays... That's how raytracing works, isn't it? =D
-
Byomeer22096y@Pogromist welp, that's boolshit. The lines are in the 3D space, too. In the end it's all just passed to the rasterizer, which is obviously a 2D thing. Even triangles are simply mapped into a 2D space and rasterized. They used to have this feature and decided to limit it to 1px thickness. Maybe because nobody used it or to make room for other features - I don't know.
-
Byomeer22096y@irene some pixels on a screen, actually =D
I could also describe a 1px thick line as a rectangle btw. So why offer line drawing in the first place?
Related Rants
Just wanted to share my latest WebGL experience...
rant
why
wtf
useful
webgl
js