Skip to content

Instantly share code, notes, and snippets.

View FransBouma's full-sized avatar

Frans Bouma FransBouma

View GitHub Profile
@FransBouma
FransBouma / DOF_With16_9Fix.fx
Created April 2, 2017 15:35
This is an updated DOF shader, which is usable for Watch_Dogs 2. It corrects (to a point) the depth buffer for cut scenes, on 16:10 monitors.
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//LICENSE AGREEMENT AND DISTRIBUTION RULES:
//1 Copyrights of the Master Effect exclusively belongs to author - Gilcher Pascal aka Marty McFly.
//2 Master Effect (the SOFTWARE) is DonateWare application, which means you may or may not pay for this software to the author as donation.
//3 If included in ENB presets, credit the author (Gilcher Pascal aka Marty McFly).
//4 Software provided "AS IS", without warranty of any kind, use it on your own risk.
//5 You may use and distribute software in commercial or non-commercial uses. For commercial use it is required to warn about using this software (in credits, on the box or other places). Commercial distribution of software as part of the games without author permission prohibited.
//6 Author can change license agreement for new versions of the software.
//7 All the rights, not described in this license agreement belongs to author.
//8 Using the Master Effect means that user accept the terms of
@FransBouma
FransBouma / quat_to_euler.md
Last active February 17, 2025 08:00
C++ version of @evbernardes' algorithm which is implemented in python

Tait-Bryan, intrinsic only specific implementation of @evbernardes' algorithm (https://github.com/evbernardes/quaternion_to_euler) in C++

Angles CameraBase::calculateAnglesFromQuaternion(DirectX::XMFLOAT4 quaternion)
{
    // Ported from: https://github.com/evbernardes/quaternion_to_euler

    int i=0;
    int j=0;
    int k=0;
/*
A pretty close port of Anisotropic Kuwahara Filtering on the GPU
source:
www.kyprianidis.com
Paper : http://www.kyprianidis.com/p/pg2009/jkyprian-pg2009.pdf
Preview App' : https://code.google.com/archive/p/gpuakf/downloads
Code : https://code.google.com/archive/p/gpuakf/source/default/source
Ported over to Reshade by Eideren
@FransBouma
FransBouma / AnselAlways.md
Last active June 7, 2023 19:08
How to remove the restrictions put on Ansel enable by a game

How to remove enable restrictions on Ansel in an Ansel-supporting game

How does enabling Ansel work

Ansel is an NVidia technology which enables a photomode with shaders in pre-defined games. A game doesn't support Ansel out of the box, it has to be setup for that, which is usually done by using the Ansel SDK. The Ansel SDK is available to people who register for an account with NVidia, and I don't have such an account, so all I provide here is what I figured out myself from what NVidia provided online and what I've seen in game code.

Ansel works with call-backs, which means the game has to register a function with Ansel which is then called when Ansel needs

@FransBouma
FransBouma / Session_Start migration.md
Created June 10, 2020 10:01
ASP.NET MVC global.asax Session_Start migration to ASP.NET Core 3 middleware

ASP.NET MVC Session_Start migration to ASP.NET Core 3 middleware

When you migrate your site from ASP.NET MVC on netfx to ASP.NET Core on .net core you might run into the problem what to do with the Session_Start method in global.asax: what's the equivalent in ASP.NET Core ?

Searching on the internet will likely make you end up on forum posts / stackoverflow posts telling you to 'write some middleware', but what does that mean? How to do that? If you feel as lost as I was, read on as this post is for you.

The request pipeline

@FransBouma
FransBouma / McFX.cfg
Last active September 24, 2021 13:53
The Witcher 3 Reshade files. I've enabled FXAA and SMAA. FXAA is for when the freecam is active as the game's DoF is then disabled. In-game it's best to disable it by default and only use SMAA. Alo use the in-game AA for the vegetation. For Reshade 1.0. If you're using 1.1, copy the settings of the sections I enabled to the v1.1 config files.
////----------//
///**GLOBAL**///
//----------////
//-Global Defines-//
//>McFX Suite General Settings<\\
//-Commentary:The McFX Suite contains various Depth of Field, ambient occlusion and vision changing shader.\nThose shader are derived from MasterEffect.
@FransBouma
FransBouma / gist:5e7031fe557df4b5b688
Created June 12, 2014 08:53
Do Contains calls in chunks. Original by Marc Gravell. Fixed for LLBLGen Pro
public static class QueryableChunked
{
public static IEnumerable<T> InRange<T, TValue>(this IQueryable<T> source,
System.Linq.Expressions.Expression<Func<T, TValue>> selector, int blockSize,
IEnumerable<TValue> values)
{
MethodInfo method = null;
foreach(MethodInfo tmp in typeof(Enumerable).GetMethods(BindingFlags.Public | BindingFlags.Static))
{
if(tmp.Name == "Contains" && tmp.IsGenericMethodDefinition && tmp.GetParameters().Length == 2)
@FransBouma
FransBouma / index.htm
Last active June 24, 2019 10:50
Starfield JS
<!DOCTYPE HTML>
<html>
<head>
<title>Simple full-browser star field effect in JS. By Otis / Infuse Project.</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
</style>
@FransBouma
FransBouma / Hitman_2016_Final_SmoothCamera_1.7.0.CT
Last active June 16, 2019 14:37
Hitman 2016 Final CT camera table, with smooth movement. For v1.7. By Jim2Point0 and myself.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="21">
<CheatEntries>
<CheatEntry>
<ID>11022</ID>
<Description>"Camera system. Toggle: INS. Enable first"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>//----------------------------------------------------------
// Reworked Hitman 2016 cheat table with free camera / timestop / FoV
@FransBouma
FransBouma / MetroExodus_PMHacks_Otis.CT
Last active May 26, 2019 06:05
Metro Exodus photomode hacks. v1.0.1. Should work for steam version now too. The FoV override could lead to a timer issue inside the game engine so everything slows down to a crawl. I have no idea why.
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="28">
<CheatEntries>
<CheatEntry>
<ID>3</ID>
<Description>"Enable ansel everywhere"</Description>
<LastState Activated="1"/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>// Disable Ansel check
// By Otis_Inf