-
A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)
-
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]
-
[R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Lookup Tables for Marching Cubes | |
// | |
// These tables differ from the original paper (Marching Cubes: A High Resolution 3D Surface Construction Algorithm) | |
// | |
// The co-ordinate system has the more convenient properties: | |
// | |
// i = cube index [0, 7] | |
// x = (i & 1) >> 0 | |
// y = (i & 2) >> 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint16_t encode16_morton2(uint8_t x_, uint8_t y_) | |
{ | |
uint32_t res=x_|(uint32_t(y_)<<16); | |
res=(res|(res<<4))&0x0f0f0f0f; | |
res=(res|(res<<2))&0x33333333; | |
res=(res|(res<<1))&0x55555555; | |
return uint16_t(res|(res>>15)); | |
} | |
//---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://danluu.com/web-bloat/ | |
https://danluu.com/octopress-speedup/ | |
https://tonsky.me/blog/pwa/ | |
https://hpbn.co/ | |
https://idlewords.com/talks/website_obesity.htm | |
https://blog.codinghorror.com/an-exercise-program-for-the-fat-web/ | |
https://developers.google.com/speed | |
https://mobile.twitter.com/danluu/status/1252792626257866754 (Google AV1 announcement) | |
https://developers.google.com/search/blog#speed-and-google-search (1st link from Google Pagespeed Insights, "Read the latest Google Search Central blog posts about performance & speed." | |
https://calendar.perfplanet.com/2020/the-mythical-fast-web-page/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Estimating CPU frequency... | |
// CPU frequency: 4.52 GHz | |
// sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem | |
// sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem | |
#define RW(x) asm("" : "+r"(x)) | |
typedef struct Node { | |
u64 value; | |
struct Node *next; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: Opcode dispatch in a bytecode VM. Assume the opcode case dispatching is mispredict heavy, | |
// and that pc, ins, next_ins, next_opcase are always in registers. | |
#define a ((ins >> 8) & 0xFF) | |
#define b ((ins >> 16) & 0xFF) | |
#define c ((ins >> 24) & 0xFF) | |
// Version 1: Synchronous instruction fetch and opcode dispatch. The big bottleneck is that given how light | |
// the essential work is for each opcode case (e.g. something like ADD is typical), you're dominated | |
// by the cost of the opcode dispatch branch mispredicts. When there's a mispredict, the pipeline restarts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Object { | |
Key key; // The key is any piece of data that uniquely identifies the object. | |
// ... | |
}; | |
struct Handle { | |
Key key; | |
Index index; // This caches a speculative table index for an object with the corresponding key. | |
}; |
D3D11 essentials:
- create window, device, device context and swap chain (easy mode): https://github.com/floooh/sokol-samples/blob/master/d3d11/d3d11entry.c
- create vertex+index buffers: https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L6702
- create textures/render targets/samplers: https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L6775
- create shaders: https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L7078
- create "pipeline state" (all the render state, vertex layout (aka input layout): https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L7192
- create "render target views": https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L7330
- start rendering (clearing etc): https://github.com/floooh/sokol/blob/b9490494987a9738a4dda484e8dda5df0dab217c/sokol_gfx.h#L7438
- MSAA resolve (when rendering to offscreen rende
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def plu_inplace(A): | |
P = np.arange(len(A)) | |
for i in range(len(A)): | |
j = i + np.argmax(np.abs(A[i:, i])) | |
P[[i, j]], A[[i, j]] = P[[j, i]], A[[j, i]] | |
A[i+1:, i] /= A[i, i] | |
A[i+1:, i+1:] -= np.outer(A[i+1:, i], A[i, i+1:]) | |
return P, A, A |
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
NewerOlder