Garry's Mod

Garry's Mod

61 ratings
VisTrace - Raytracing Library
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Build, Realism
File Size
Posted
Updated
6.581 MB
Jun 28, 2021 @ 8:03pm
Dec 16, 2022 @ 1:46pm
27 Change Notes ( view )

Subscribe to download
VisTrace - Raytracing Library

In 2 collections by Derpius
TAS Collection
92 items
TAS Build Server
69 items
Description



GitHub: https://github.com/Derpius/VisTrace
Discord: https://discord.gg/N4NxezCgFQ

Overview
VisTrace is a binary module that allows tracing entity visual meshes at speeds at or faster than traditional trace methods, which it achieves with bounding volume hierarchies[en.wikipedia.org] using the C++ BVH library[github.com] by madmann91 on GitHub.

What This Addon Does
While the binary module does most of the work, the addon handles versioning, provides integration with other addons like StarfallEx, and various quality of life features like the BSDF material toolgun.

The binary module allows high performance vismesh intersection with almost as much ease as using traditional trace functions, as well as providing texture and material information and various helper functions.

What This Addon Doesn't Do
This doesn't automatically give you a fully fledged ray/path tracer (although it makes it very easy), just offloads the performance intensive calculations to C++.

Who This Addon is For
If you've ever written a tracer in GMod, made a project requiring precise intersections with entity geometry (for instance a ranged weapon), or if you've wanted to get the UV coordinates at a hit point for whatever reason (for instance, a paintbrush, where you could set the material of an entity to a render target, and use the hit UVs to paint onto the texture at the position the player is looking), then this addon is for you.

Installation
Get the latest release build of the binary module from my GitHub repo[github.com], or clone and compile from source (if you don't know how to do this then you probably don't need to compile yourself), then place the dll in garrysmod/lua/bin.
As for the addon, you can either use the binary module by itself (no integration with other addons, and you'll need to use CS Lua to load and interface with the module), or you can subscribe to the addon here / download from the repo and mount, which handles versioning automatically, and adds compatibility with addons like StarfallEx.

Usage
Documentation for the GLua API doesn't currently exist but will be added to the repo's wiki (however the Starfall API mirrors it), as for the Starfall library, documentation is generated automatically and is available in the SF Helper.

tags: ray tracing, raytracing, path tracing, pathtracing, binary module, rtx, rendering
136 Comments
Ktotoshniy Jan 22 @ 1:00pm 
Really cool but it can't parse quite a lot of maps specifically large ones and just returns the sky.
bluecoolman280 Dec 2, 2024 @ 10:01pm 
oh, nice. too bad i dont know how to code (the only kind of ""coding"" i know is scratch, but i dont think that one really counts as real coding.) so maybe sometime in the future someone could try making a post-processing GI addon for gmod
Derpius  [author] Dec 2, 2024 @ 12:44pm 
> if there were some way to make something like fast GI in gmod, but as a post-processing effect that would be cool

Yes, you could implement one of the many forms of SSGI as a binary module or similar. That's well outside the scope of this addon though
bluecoolman280 Dec 1, 2024 @ 10:55pm 
(ik i can just use reshade, but that has problems with looking glitchy in a map like gm_construct despite enabling something in add-ons in reshade)
bluecoolman280 Dec 1, 2024 @ 10:52pm 
if there were some way to make something like fast GI in gmod, but as a post-processing effect that would be cool
bluecoolman280 Nov 28, 2024 @ 3:48pm 
apparently my cpu is AMD Ryzen 5 2400G with Radeon Vega Graphics
Derpius  [author] Nov 28, 2024 @ 1:02pm 
You can get _kind of_ interactive framerates with VisTrace, but at the end of the day it's single-threaded, not particularly performant and has overhead inherent in the communication with Lua

I'm not aware of any projects which build on VisTrace with the aim of real time rendering
Assuming your CPU is about as low spec'd as your GPU, you're unlikely to get very interactive framerates even with a purpose built software or GPU renderer using ray or path tracing
bluecoolman280 Nov 27, 2024 @ 7:53pm 
no, i'm not talking about rtx remix, dxr, or any of that tho
bluecoolman280 Nov 27, 2024 @ 7:53pm 
i have a nvidia geforce gtx 1650
bluecoolman280 Nov 27, 2024 @ 7:53pm 
is there any real-time raytracing things that work with VisTrace?