Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
rupy's avatar
rupy
Honored Guest
11 years ago

[SOLVED] GL_LINES & normal

My lasers are just lines with a certain line width, but they end up orienting their normals different in each eye becuase of the stereoscopic rendering (- and | for the same beam) which is bad, stomach churning even. How do I tell OpenGL which way I want these oriented?

6 Replies

  • Why do you use a line strip to begin with? It isn't exactly the best way to visualise beams, let alone laser beams that are completely invisible. Either way, you can use actual 3d models for beams. The most common approach is a "snowflake" beam - it looks great yet being really simple. Unless you have, like, tens of hundreds of beams simultaneously, you won't have problems with that.
  • rupy's avatar
    rupy
    Honored Guest
    Yes, it's star wars beams and it's a MMO so alot of them... how would you draw a snowflake beam with OpenGL, google retuned nothing...
  • You just render a bunch of two-sided billboards shaped as a snowflake, and that's it. You can create a corresponding 3d model.

    I don't beleive you'd have to draw all these beams from all around your MMO map simultaneously though. Culling and such. Even then, e.g. War Thunder can handle thousands of tracing bullets flying around.
  • rupy's avatar
    rupy
    Honored Guest
    Solved it with glEnable(GL_LINE_SMOOTH);

    Draws them like this \ * / where * = ship center, at least it's constant between view ports, so all left are \ and all right are all /...

    Setting the normal does not seem to work.

    Wouldn't billboards be more expensive?

    Yes culling for sure, but for now I need to finish the engine as fast as possible to start tweaking gameplay...

    Thanks for feedback!
  • If your task is finishing the engine then what graphical effects look like is none of your concern, just leave it alone.
  • rupy's avatar
    rupy
    Honored Guest
    Well I want to be able to play in the rift without throwing up... a good game is all about attention to the little things, but you are right...