Jump to content
  • Advertisement
Sign in to follow this  
baykalsa

_== Lasers ==_ ?

This topic is 5470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi.I am making a RTS game and ý can't make lasers fine.I've tried some methods(like bilboarding) but they didn't work.I want lasers that have same thickness whereever in the game space.If you know any method please let me know.And second question how can i enable alpha blending for vertex arrays.I am trying to use glColor4f before the array but it doesn't work.That's all.I am waiting your responses... Baykal artist.amazon.com/baykal

Share this post


Link to post
Share on other sites
Advertisement
I don't use particles for laser.I use a quad from source unit pos to target.you know screen based bilboarding can't be used for this,and in axis aligned bilboarding quad doesn't have same thickness for all angles of view.I think there should be a method which uses matrix and which calculates thickness.there should be...But...I don't know?!?!?


Baykal
artist.amazon.com/baykal

Share this post


Link to post
Share on other sites
I don't know where I read this. The probably most common and best way to do it is by having the laser as a quad but then rotated right so that it's allways "as big as possible" to the player's view.

Hard to explain.

/MindWipe

Share this post


Link to post
Share on other sites
MindWipe,i think your method is more suitable for First Person Views but my game has an isometric view.

Baykal
artist.amazon.com/baykal

Share this post


Link to post
Share on other sites
Not really.
If you think about it, billboarding the quad (ie orientating it so that every frame, it always faces the camera) works fine in both respects. It's orientation to the actual camera you're rendering from, not specificly the player model that you're controlling.

~Main

Share this post


Link to post
Share on other sites
Yeah all you need is axil billboarding (like used for sprite tree's) in the direction the lazer is going.

Share this post


Link to post
Share on other sites
Don't make it complicated? Just use lines and set the line width's to whatever you need with glLineWidth. They look the same no matter the distance.

Share this post


Link to post
Share on other sites
Thanks guys!You are right.It really works.I use two quad,one for inner brighter area,the other is outer area.But there is still problem when i use red color for laser,it become diffucult to see the red color,only the brighter inner area can bee seen clearly.I know this is about blending i use GL_ONE,GL_ONE for blending .While laser passes through a dark area it can be seen clearly but not passes on the landscape (texture is green).


Baykal
artist.amazon.com/baykal

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!