Skip to content

Instantly share code, notes, and snippets.

View jaybaird's full-sized avatar

Jay Baird jaybaird

  • Ferndale, WA
View GitHub Profile
//MIT License
//Copyright (c) 2021 Felix Westin
//Source: https://github.com/Fewes/MinimalAtmosphere
//Ported to GLSL by Marcin Ignac
#ifndef ATMOSPHERE_INCLUDED
#define ATMOSPHERE_INCLUDED
// -------------------------------------
@Fewes
Fewes / PixelDot.shader
Last active May 12, 2021 04:38
Renders a screen-aligned, distance-independent, resolution-independent, pixel-perfect quad in Unity. Use it with the built-in quad mesh. You don't have to rotate or scale the mesh renderer, the shader will take care of it.
Shader "FX/PixelDot"
{
Properties
{
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
_Size ("Pixel Size", Range(1, 64)) = 1
}
SubShader
{
@ayamflow
ayamflow / cheap-parabola.glsl
Last active May 31, 2022 18:52
Cheap parabola in GLSL
// Doesn't require pow()
// Not smoothed i.e. like a triangle function
float linearParabola(float x) {
return 1.0 - abs(x * 2.0 - 1.0);
}
// Slightly smoothed, no math function
float parabola(float x) {
return 4.0 * x * (1.0 - x);
@d7samurai
d7samurai / .readme.md
Last active May 20, 2024 15:08
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Also check out Minimal D3D11 pt2, reconfigured for instanced rendering and with a smaller, tighter, simplified overall code structure, or Minimal D3D11 pt3, with shadowmapping + showcasing a range of alternative setup and rendering techniques.

@ayamflow
ayamflow / layer.glsl
Created February 8, 2018 00:24
Layer 2 textures on top of each other in GLSL
// https://stackoverflow.com/questions/24480901/libgdx-overlay-texture-above-another-texture-using-shader
vec4 layer(vec4 foreground, vec4 background) {
return foreground * foreground.a + background * (1.0 - foreground.a);
}
#pragma glslify: export(layer);
@ikrima
ikrima / build.cs
Created April 6, 2017 20:17
4.15 UE4 Optimized Build Rules
public BBR(TargetInfo Target)
{
//Config
//BuildConfiguration.RelativeEnginePath = /* ...*/;
//Debug
//---BuildConfiguration.bOmitPCDebugInfoInDevelopment = true /* d=false */;
//BuildConfiguration.bSupportEditAndContinue = false /* d=false */;
//BuildConfiguration.bDisableDebugInfoForGeneratedCode = true /* d=true */;
//BuildConfiguration.bAllowLTCG = false /* d=false */;