Skip to content

Instantly share code, notes, and snippets.

View mxpv's full-sized avatar

Maksym Pavlenko mxpv

View GitHub Profile
@alichraghi
alichraghi / zig-shaders.md
Last active September 22, 2025 09:39
Zig Shaders

What does it look like?

Here is a simple fragment shader with uniform buffers:

const std = @import("std");
const gpu = std.gpu;

const UBO = extern struct {
    object_color: @Vector(4, f32),
    light_color: @Vector(4, f32),
@Ipotrick
Ipotrick / Efficient GPU Work Expansion.md
Last active July 11, 2025 16:13
Efficient GPU Work Expansion

What is "Work Expansion"

In a GPU-driven renderer, "work expansion" is a commonly occurring problem. "Work Expansion" means that a single item of work spawns N following work items. Typically one work item will be executed by one shader thread/invocation.

An example for work expansion is gpu driven meshlet culling following mesh culling. In this example a "work item" is culling a mesh, where each mesh cull work item spawns N following meshlet cull work items.

There are many diverse cases of this problem and many solutions. Some are trivial to solve, for example, when N (how many work items are spawned) is fixed.

@h3r2tic
h3r2tic / raymarch.hlsl
Last active September 21, 2025 11:18
Depth buffer raymarching for contact shadows, SSGI, SSR, etc.
// Copyright (c) 2023 Tomasz Stachowiak
//
// This contribution is dual licensed under EITHER OF
//
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
// MIT license (http://opensource.org/licenses/MIT)
//
// at your option.
#include "/inc/frame_constants.hlsl"
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active October 9, 2025 16:27
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

@alexsinger
alexsinger / build.gradle
Last active July 10, 2019 04:42
Separate Crashlytics reporting for debug and release buildTypes using a Gradle build
// The following code allows an app to report Crashlytics crashes separately
// for release and debug buildTypes when using Gradle. This code should be inserted
// into the specified locations within your build.gradle (Module:app) file
// The buildTypes { } block should be inserted inside the android { } block
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ext.crashlyticsApiSecret = "release api secret"
@ericelliott
ericelliott / essential-javascript-links.md
Last active June 14, 2025 18:43
Essential JavaScript Links
@mxpv
mxpv / gist:5879528
Created June 27, 2013 19:21
How to make sublime text the default editor for git on Windows
git config --global core.editor "'c:/program files/sublime text 2/sublime_text.exe' -w"
@miketrebilcock
miketrebilcock / PasswordResetService.cs
Last active August 14, 2022 21:16
Password Resetting in Servicestack
using CORE.Kernel.ExtensionMethods;
using CORE.Models;
using ServiceStack.Common;
using ServiceStack.Common.Web;
using ServiceStack.FluentValidation;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
using ServiceStack.ServiceInterface.Auth;
using ServiceStack.ServiceInterface.ServiceModel;
using ServiceStack.ServiceInterface.Validation;
@devudilip
devudilip / SUBLIME TEXT2 INSTALLATION
Created October 22, 2011 08:54
HOW TO INSTALL SUBLIME TEXT 2 ON UBUNTU 11.10
#BECOME SUPER USER#
sudo -i
#add sublime to repository#
add-apt-repository ppa:webupd8team/sublime-text-2
#update#
anonymous
anonymous / video.js
Created October 21, 2011 18:57
Node js on the fly video conversion
var child_process = require('child_process'),
sys = require('sys'),
http = require('http'),
parse = require('url').parse,
fs = require('fs');
var spawn = child_process.spawn;
var exec = child_process.exec;