Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Rosseaux BeRo1985

View GitHub Profile
@BeRo1985
BeRo1985 / multisampled_font_sdf.glsl
Last active December 19, 2022 14:08
Multisampled SDF for text rendering (4x AA with single texture lookup, 16x with four lookups)
View multisampled_font_sdf.glsl
// Multisampled SDF for text rendering (4x AA with single texture lookup, 16x with four lookups)
// It is for SDF text rendering with 16x antialiasing with only four texture lookups, where an
// SDF texture texel in turn also has four individual SDF values in the RGBA color channels in
// a 4-Rook/RGSS sampling pattern.
// Copyright (C) 2022, Benjamin 'BeRo' Rosseaux - License: Unlicense ( http://unlicense.org/ )
const float SQRT_0_DOT_5 = sqrt(0.5);
#if FILLTYPE == FILLTYPE_ATLAS_TEXTURE
@BeRo1985
BeRo1985 / attach_vhd_at_startup_windows_10.md
Created November 11, 2022 23:47 — forked from ianfabs/attach_vhd_at_startup_windows_10.md
How to Automount VHD on windows 10
View attach_vhd_at_startup_windows_10.md

So here's a pretty neat thing, I use VHD's to organize the space on my computer. You can too!

  • Click Start

  • Type in the search bar "Disk par" =>

  • Click first result =>

  • In the program, click "Action" =>

@BeRo1985
BeRo1985 / MIDIEventIntervalSearch.pas
Created September 3, 2020 10:30
Interval-tree-less interval search on sorted array of linked MIDI events
View MIDIEventIntervalSearch.pas
procedure TEngineMIDIEventList.FindInterval(const aResultList:TEngineMIDIEventDynamicArrayList;const aFromTime,aToTime:TEngineTime);
var Lower,Upper,Mid,Index,StartIndex,MinIndex,MaxIndex,
EventFromIndex,EventToIndex,NextStartIndex,TryIndex:SizeInt;
Event,TemporaryEvent:TEngineMIDIEvent;
FromTime,NextFromTime,EventFromTime,EventToTime,
MinEventTime,MaxEventTime:TEngineTime;
DoAdd:boolean;
begin
if fCount>0 then begin
@BeRo1985
BeRo1985 / gfxapiwrappers.md
Last active May 27, 2020 09:13
GFX API wrappers
View gfxapiwrappers.md
@BeRo1985
BeRo1985 / compute shader NVIDIA driver 347.09 WHQL slowdown bug
Last active April 11, 2020 04:38
SDSM compute shader NVIDIA driver 347.09 WHQL slowdown bug
View compute shader NVIDIA driver 347.09 WHQL slowdown bug
With version 347.09 WHQL tooks my SDSM tighting compute shader whole 70 ms per frame instead with the old verson 344.75 under 1ms (circa 0.7ms) on my GTX970.
See sdsm_reduce_tighting.glsl here, the $-stuff is my own preprocessor.
I'ver tracked to the "((lLinearZ >= reduceDataPartitions[lPartitionIndex].x) && (lLinearZ <= reduceDataPartitions[lPartitionIndex].w))" (in sdsm_reduce_tighting.glsl) comparsion down, but really just the comparsion itself, because:
70ms per frame:
if((lLinearZ >= reduceDataPartitions[lPartitionIndex].x) && (lLinearZ <= reduceDataPartitions[lPartitionIndex].w)){
minBoundsSun[lPartitionIndex] = min(minBoundsSun[lPartitionIndex], lSunLightSpaceCoord.xyz);
@BeRo1985
BeRo1985 / BGCMM.pas
Created April 8, 2020 08:19
A very old experimental garbage collector memory manager project for Delphi and FreePascal
View BGCMM.pas
//////////////////////////////////////////////////////////////////////////////////////
//
// BeRo Garbage Collector Memory Manager - Copyright (C) 2011, Benjamin 'BeRo' Rosseaux
// Warning: CODED IN FEW HOURS ON A SINGLE DAY, SO USE IT ON YOUR OWN RISK!
//
//////////////////////////////////////////////////////////////////////////////////////
// Version: 2011.03.14.0013
//////////////////////////////////////////////////////////////////////////////////////
//
// Description:
@BeRo1985
BeRo1985 / en_DE
Created March 25, 2018 14:52
/usr/share/i18n/locales/en_DE
View en_DE
comment_char %
escape_char /
% Locale for English locale in Germany
LC_IDENTIFICATION
title "English locale for Germany"
source ""
address ""
contact "Benjamin Rosseaux"
email "benjamin@rosseaux.de"
@BeRo1985
BeRo1985 / index.html
Created May 15, 2019 08:13
JS Bin ecmascript string type wierdness fun // source https://jsbin.com/xinogin
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="ecmascript string type wierdness fun">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@BeRo1985
BeRo1985 / order_independent_transparency.glsl
Last active May 10, 2019 21:32
Hybrid atomic loop weighted blended order independent transparency implementation
View order_independent_transparency.glsl
// Hybrid atomic loop weighted blended order independent transparency implementation (work in progress)
// Copyright (C) 2014 by Benjamin 'BeRo' Rosseaux
// Licensed under the CC0 license, since in the German legislation exists no public
// domain.
// This implementation needs at least OpenGL 4.3 as minimum OpenGL version, due to my usage of shader storage buffer objects here
// Supports also additive blending for emission color portions
uniform sampler2D uTexTailWeightedBlendedOrderIndependentTransparencyColor;
@BeRo1985
BeRo1985 / ForceDedicatedGPUUsageForOpenGL.pas
Created May 30, 2018 04:04
Force usage of dedicated GPU for OpenGL with Delphi and FreePascal/Lazarus on Multi-GPU systems such as Notebooks on Windows
View ForceDedicatedGPUUsageForOpenGL.pas
// Force usage of dedicated GPU for OpenGL with Delphi and FreePascal/Lazarus on Multi-GPU systems such as Notebooks on Windows
// Insert that into your main source file, which is for example the .dpr (Delphi) or .lpr (Lazarus) file
{$define ForceDedicatedGPUUsage} // then you can uncomment and recomment this line, for compile-time-switching between
// integrated GPU and dedicated GPU
{$if defined(Windows) and defined(ForceDedicatedGPUUsage) and (defined(cpu386) or defined(cpux64) or defined(cpuamd64))}
{$ifdef fpc}
{$asmmode intel}
{$endif}