开发者

How to draw smooth lines without using GLSL, FSAA nor GL_LINE_SMOOTH?

开发者 https://www.devze.com 2023-03-21 22:02 出处:网络
So i need a method to do smooth lines without using: Full Screen Antialiasing (slow) Shaders (not supported on all cards)

So i need a method to do smooth lines without using:

  • Full Screen Antialiasing (slow)
  • Shaders (not supported on all cards)
  • GL_LINE_SMOOTH (causes a crash on some cards)

Only way i could think of doing this was using a textured rectangle that is always faced at camera direction, but the problems are:

1. how do i always face the rectangle at the camera (efficiently) ?

开发者_如何学运维 2. how do i keep its size always the same no matter how far away my camera is looking at it?

Any other ideas?


Billboarding is a simple concept, but can be difficult to implement. A billboard is a flat object, usually a quad (square), which faces the camera. This direction usually changes constantly during runtime as the object and camera move, and the object needs to be rotated each frame to point in that direction. There are two types of billboarding: point and axis. Point sprites, or point billboards, are a quad that is centered at a point and the billboard rotates about that central point to face the user. Axis billboards come in two types: axis aligned and arbitrary. The axis-aligned (AA) billboards always have one local axis that is aligned with a global axis, and they are rotated about that axis to face the user. The arbitrary axis billboards are rotated about any axis to face the user.

http://nehe.gamedev.net/data/articles/article.asp?article=19


You can use point sprites, they are always the same size and always face the camera. http://www.opengl.org/registry/specs/ARB/point_sprite.txt

0

精彩评论

暂无评论...
验证码 换一张
取 消