{"id":26371529,"url":"https://github.com/blueamulet/sourcertxtweaks","last_synced_at":"2026-02-18T14:03:54.713Z","repository":{"id":65251933,"uuid":"588840536","full_name":"BlueAmulet/SourceRTXTweaks","owner":"BlueAmulet","description":"A set of patches for Source Engine games to improve RTX Remix experience","archived":false,"fork":false,"pushed_at":"2025-03-25T05:56:18.000Z","size":38,"stargazers_count":26,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-22T08:49:55.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueAmulet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-14T07:28:28.000Z","updated_at":"2025-08-15T18:32:33.000Z","dependencies_parsed_at":"2024-03-21T22:32:14.725Z","dependency_job_id":"19374e28-1e61-42cf-b80b-32fa5e65fe62","html_url":"https://github.com/BlueAmulet/SourceRTXTweaks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BlueAmulet/SourceRTXTweaks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAmulet%2FSourceRTXTweaks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAmulet%2FSourceRTXTweaks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAmulet%2FSourceRTXTweaks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAmulet%2FSourceRTXTweaks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueAmulet","download_url":"https://codeload.github.com/BlueAmulet/SourceRTXTweaks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueAmulet%2FSourceRTXTweaks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29581538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-17T00:39:24.295Z","updated_at":"2026-02-18T14:03:54.680Z","avatar_url":"https://github.com/BlueAmulet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RTX Remix patches for Source Engine games\r\n\r\nThis is a set of unofficial patches and recommendations for various Source Engine based games, to improve lighting and reduce crashes when using RTX Remix.  \r\n**Disclaimer:** Source Engine games may make use of Valve Anti-Cheat. By using these patches, you accept that I am not responsible for any issues or damages resulting from the use of these patches. Do not use those games in VAC protected servers while using RTX Remix, these patches, or any other modification. To protect yourself from accidentally joining a VAC protected server, run games with the `-insecure` launch option.  \r\nNow that that's out of the way, a python script called `applypatch.py` has been provided to hopefully automatically apply the patches to your game. Place `applypatch.py` inside of your game folder and run it. Patched DLLs will appear within a \"patched\" directory, copy these over the original.\r\n\r\n## Specific games\r\n\r\n[Garry's Mod](https://github.com/BlueAmulet/SourceRTXTweaks/tree/main/garrysmod)  \r\n\r\n## Recommendations\r\n\r\nThe following launch options should be beneficial to all Source Engine based games:\r\n\r\n## Technical Info\r\n\r\nThis is to help with finding the relevant code again incase a game receives and update.  \r\nAll technical info statements below are in the context of a disassembler such as IDA Pro or Ghidra.\r\n\r\n### c_frustumcull\r\n\r\nPortal with RTX added in c_frustumcull, which prevents objects out of view from being skipped.  \r\nThis primarily fixes missing shadows, though technically it is also a light leak.\r\n\r\n\u003cdetails\u003e  \r\n\u003csummary\u003eTechnical info\u003c/summary\u003e\r\n\r\nIn engine.dll or client.dll, search for the following set of bytes: `83 C4 0C 83 F8 02 74`  \r\nThere should be several hits in 2 functions within engine.dll, and 1 function within client.dll.  \r\nReplace the start of the functions with the following bytes: `31 C0 C3`  \r\nThis is equal to the following instructions:  \r\n```  \r\nxor al, al  \r\nretn  \r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n### r_forcenovis\r\n\r\nAlso new to Portal with RTX is r_forcenovis, which disables the BSP level visibility checks. (guessing, unsure)  \r\nThis fixes some light leaking issues.\r\n\r\n\u003cdetails\u003e  \r\n\u003csummary\u003eTechnical info\u003c/summary\u003e\r\n\r\nIn client.dll, search for \"CViewRender::Render\" and go to the function referencing this string.  \r\nNear the top of this function, there should be a byte sized `this` member being set to 0:  \r\n`*(byte*)(this + 844) = 0;` or `this[844] = 0;`  \r\nThe number may not be 844. Change this to 1.\r\n\r\nIf the code is optimized to make use of a register known to be zero to assign the value:  \r\nWith a debugger such as [x64dbg](https://x64dbg.com/), set a break point on this instruction.  \r\nCheck the address listed and set a hardware byte read breakpoint on it.  \r\nThis should get you the function that reads this member, change it to the following instructions:  \r\n```  \r\nmov    al,0x1  \r\nretn  \r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n### r_frustumcullworld\r\n\r\nThis exists inside Source Engine already, but Portal with RTX extended it to also disable various backface culling checks.  \r\nThis fixes light leaks when a wall is not facing the camera.\r\n\r\n\u003cdetails\u003e  \r\n\u003csummary\u003eTechnical info [World backfaces]\u003c/summary\u003e\r\n\r\nThis one is hard to explain, apologies in advance.  \r\nIn engine.dll, search for \"r_frustumcullworld\" and go to the function referencing this string.  \r\nThere should be a function call with parameters (byte, \"r_frustumcullworld\", \"1\", 0)  \r\nIf using IDA Pro and the byte variable is missing, decompile the inner function and then refresh the first function.  \r\nGo to the byte variable and skip ahead 0x1C, the dword variable here is the actual variable for r_frustumcullworld.  \r\nFind references to this dword variable and go to the function found.  \r\nThere should be an if else statement on a function parameter, both containing a check on r_frustumcullworld and a function call.  \r\nGo into the function call contained in else (code handled when parameter is false)  \r\nInside the function should be code like this, go inside the function call:  \r\n```  \r\nif (*(int*)var \u003e= 0) {  \r\n\tfunction_call();  \r\n\treturn;  \r\n}  \r\n```  \r\nThere will be two loops, disable the first loop entirely.  \r\nInside the second loop is a check against `\u003c -0.01f or -0.0099999998f`, this is a backface check, skip this check.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e  \r\n\u003csummary\u003eTechnical info [Brush entity backfaces]\u003c/summary\u003e\r\n\r\nFor Garry's Mod:  \r\n    Search for \"Refusing to render the map on an entity to prevent crashes!\" and go to the function referencing this string.  \r\nFor other games:  \r\n    Check for references on the -0.01f float found above, and goto the nearest function.  \r\n    This function should also contain references to the \"$AlphaTestReference\" string  \r\nFind the check against `\u003c -0.01f or -0.0099999998f`, this is a backface check, skip this check.\r\n\r\n\u003c/details\u003e  \r\n\r\n### failed to lock vertex buffer in CMeshDX8::LockVertexBuffer  \r\n### integer division by zero\r\n\r\nCredits to [@khang06](https://github.com/khang06) for this fix, found [here](https://github.com/khang06/misc/tree/master/reversing/source/portalrtxvbfix)\r\n\r\n\u003cdetails\u003e  \r\n\u003csummary\u003eTechnical info\u003c/summary\u003e\r\n\r\nSearch for \"CMeshMgr::FindOrCreateVertexBuffer (dynamic VB)\" and go to the function referencing this string.  \r\nAt the top of the function should be a function call taking two arguments, go inside this function.  \r\nThis function should consist of a single call followed by a value return:  \r\n`function_call(0, a1, a2, v3);`  \r\nAfter the function call and eax has been loaded, add in the following instructions:  \r\n```  \r\ntest   eax,eax  \r\njne    +0x2  \r\nmov    al,0x4  \r\n```\r\n\r\n\u003c/details\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueamulet%2Fsourcertxtweaks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueamulet%2Fsourcertxtweaks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueamulet%2Fsourcertxtweaks/lists"}