• Direction vector that Skybox is visible from
    2 replies, posted
I've been fiddling with render "holos", and discovered that I could use util.IsSkyboxVisibleFromPoint to draw a line to where your player can see outside a building from, be it a doorway or window. However I've found that certain results don't seem to make sense. The following examples are near the color room on gm_construct, using the code [CODE] local function visibletostring(visible) if(visible) then return "Yes" else return "No" end end function CanSeeSkybox() local isVisible = util.IsSkyboxVisibleFromPoint(LocalPlayer():EyePos()) Msg("Can See skybox from EyePos? ") MsgN(visibletostring(isVisible)) end hook.Add("RenderScreenspaceEffects", "canseeskybox", CanSeeSkybox) [/CODE] The first example seems correct, you cannot see the skybox from this position. [IMG]http://cloud-4.steampowered.com/ugc/708489437356081691/A770A62E4E23EFCC035643C78EA505299B7A30A9/1024x578.resizedimage[/IMG] However step to the right just a slight bit, and you somehow can see the skybox. [IMG]http://cloud-4.steampowered.com/ugc/708489437356079211/12BF41B3BBA616CFFF6F1BB028380D2D10C675C9/1024x578.resizedimage[/IMG] If I step forward a slight bit the skybox also becomes visible from this spot in the color room. [IMG]http://cloud-4.steampowered.com/ugc/703985853883122089/CF9E63BF220E7B8FA6FC49020E944925A3478E59/1024x578.resizedimage[/IMG] Can anybody explain how util.IsSkyboxVisibleFromPoint works, or is the function possibly broken/incomplete? And finally how could I get a direction vector from where we can see the skybox from? (possibly a future feature request)
Been half a week, was hoping for a reply by now. Any insight to this question would be greatly appreciated.
I believe that function returns if the skybox is in your PVS not your line of sight.
Sorry, you need to Log In to post a reply to this thread.