Skip to content

Instantly share code, notes, and snippets.

View LYP951018's full-sized avatar

Yupei Liu LYP951018

  • Tencent
  • Shenzhen, Guangdong
View GitHub Profile
@pixelsnafu
pixelsnafu / CloudsResources.md
Last active August 28, 2024 14:20
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

//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@AhnMo
AhnMo / http_client_get.cc
Last active September 17, 2024 17:14
Wininet HTTP Client Example
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#pragma comment (lib, "Wininet.lib")
int main(int argc, char *argv[]) {
HINTERNET hSession = InternetOpen(
L"Mozilla/5.0", // User-Agent
@starwing
starwing / rbtree.c
Last active August 13, 2019 14:41
新写的红黑树……求轻喷……
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
typedef struct rb_Node rb_Node;
struct rb_Node {
rb_Node *parent, *k[2];
unsigned size : sizeof(unsigned)*CHAR_BIT-1;
unsigned color : 1;
@nothings
nothings / kotaku_hzd.md
Last active September 4, 2024 06:33
Why Frustum Culling Matters, and Why It's Not Important

There is a nice GIF illustrating a technique called "frustum culling" in this Kotaku article: http://kotaku.com/horizon-zero-dawn-uses-all-sorts-of-clever-tricks-to-lo-1794385026

The interwebs being what they are, this has also led to some controversy.

Some people have interpreted the opening sentence "Every time you move the camera in Horizon Zero Dawn, the game is doing all sorts of under-the-hood calculations, loading and unloading chunks of world to ensure that it all runs properly," as being about the GIF; that's not what frustum culling does, but that's probably not what the article's author meant anyway.

@lichray
lichray / 203.cc
Created March 24, 2017 22:35
"Two star programming" with no star
#include <functional>
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
auto ls = std::ref(head);
while (ls != nullptr) {
if (ls.get()->val == val) {
auto p = ls.get();
@ericniebler
ericniebler / constexpr_string.cpp
Created December 10, 2016 04:27
An almost perfect design for a hybrid constexpr/runtime string
// Copyright Eric Niebler 2016
#include <cstddef>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <utility>
#include <type_traits>
#define REQUIRES(X) \
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
@9to5IT
9to5IT / Find-RegistryValues.ps1
Created June 23, 2016 12:06
PowerShell: Enumerate & Search Registry Key values with PowerShell
$RegKey = (Get-ItemProperty 'HKCU:\Volatile Environment')
$RegKey.PSObject.Properties | ForEach-Object {
If($_.Name -like '*View*'){
Write-Host $_.Name ' = ' $_.Value
}
}