Skip to content

Instantly share code, notes, and snippets.

View SanielX's full-sized avatar

Alex SanielX

View GitHub Profile
@bazhenovc
bazhenovc / the_sane_rendering_manifesto.md
Last active May 14, 2024 10:57
The Sane Rendering Manifesto

The Sane Rendering Manifesto

The goal of this manifesto is to provide an easy to follow and reasonable rules that realtime and video game renderers can follow.

These rules highly prioritize image clarity/stability and pleasant gameplay experience over photorealism and excess graphics fidelity.

Keep in mind that shipping a game has priority over everything else and it is allowed to break the rules of the manifesto when there are no other good options in order to ship the game.

Do not use dynamic resolution.

From time to time I receive questions on the depth aware upsampling mentioned in the INSIDE-rendering presentation: https://loopit.dk/rendering_inside.pdf#page=39

noisy blur

The goal of this technique is to take the texture-output from a half-resolution pass, containing the results of sampling volumetric fog - and scale it up to full resolution. This presents two challenges:

  • Making sure samples from the low-resolution buffer, do not spill on top of foreground objects in the high-resolution buffer
  • Making sure the samples in the volumetric fog can be properly accumulated by TAA after upsampling

@Chillu1
Chillu1 / FullscreenGameView.cs
Last active March 14, 2024 08:47
FullscreenGameView utility, for automatic fullscreen on play with toggle option (Game view fullscreen in editor)
/*
MIT License
Copyright (c) 2021 Chillu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Kleptine
Kleptine / PlacerTool.cs
Created March 29, 2021 18:55
A Unity editor tool mode (like Translate, Rotate, etc) that lets you click/drag to position objects in the scene.
// Author: John Austin
// Licensed under MIT License
using System;
using System.Reflection;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEditor.ShortcutManagement;
using UnityEngine;
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active May 2, 2024 13:46
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

@sebbbi
sebbbi / SinglePassMipPyramid.hlsl
Last active January 12, 2024 07:16
Single pass globallycoherent mip pyramid generation
// NOTE: Must bind 8x single mip RWTexture views, because HLSL doesn't have .mips member for RWTexture2D. (SRVs only have .mips member)
// NOTE: globallycoherent attribute is needed. Without it writes aren't guaranteed to be seen by other groups
globallycoherent RWTexture2D<float> MipTextures[8];
RWTexture2D<uint> Counters[8];
groupshared uint CounterReturnLDS;
[numthreads(16, 16, 1)]
void GenerateMipPyramid(uint3 Tid : SV_DispatchThreadID, uint3 Group : SV_GroupId, uint Gix : SV_GroupIndex)
{
[unroll]