Performance questions. render.DrawBeam vs Vector:ToScreen( )
0 replies, posted
Inbetween render.DrawBeam() and Vector:ToScreen(), which function takes longer? The reason I ask is because I want to not draw the beam when its behind something completely. So would it be cheaper just to render the beam or call Vector:ToScreen()?
Many thanks,
[editline]17th November 2012[/editline]
Hmm ok, I did some benchmarks.
Calling each function 5000 times and timing them.
5000 calls to Vector:ToScreen() take 0.0044828879842023 (SysTime()) to complete
5000 calls to render.AddBeam() take 0.0048727422441841 (SysTime()) to complete
so thats about a 0.0003 differnce.
as a refrence:
5000 calls to Vector:Dot() take 0.00069243755512798 (SysTime()) to complete
So I guess I can just plain render the beams instead of checking if they are visible and then rendering them.
Sorry, you need to Log In to post a reply to this thread.