-
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 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
#include <windows.h> | |
#include <intrin.h> | |
#define Assert(x) do { if (!(x)) __debugbreak(); } while (0) | |
static struct | |
{ | |
DWORD process_id; | |
char data[4096 - sizeof(DWORD)]; | |
}* ods_buffer; |
This file contains 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
Root Signature doesn't match Compute Shader: A Shader is declaring a resource object as a texture using a register mapped to a root descriptor SRV (RegisterSpace=0, ShaderRegister=0). | |
SRV or UAV root descriptors can only be Raw or Structured buffers. | |
[ STATE_CREATION ERROR #882: CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH] | |
When binding a texture object directly to root signature rather than through descriptor table. | |
D3D12 CORRUPTION: ID3D12CommandList::CopyTextureRegion: pResource in the first parameter is corrupt. [ MISCELLANEOUS CORRUPTION #3: CORRUPTED_PARAMETER1] | |
This file contains 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
// Copyright (C) 2018, Benjamin "BeRo" Rosseaux ([email protected]) - License: CC0 | |
// Hint: It's not super accurate, but it should be good enough for games and demos with sky rendering. | |
#version 430 | |
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; | |
uniform vec3 tc; // Time constant | |
layout(std430) buffer ssboAstronomy { | |
vec3 sunPosition; | |
float sunDistance; |
This file contains 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
/* | |
The MIT License (MIT) | |
Copyright (c) 2018 Eric Arnebäck | |
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 |
This file contains 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
// Taken from the Rust code base: https://github.com/rust-lang/rust/blob/3809bbf47c8557bd149b3e52ceb47434ca8378d5/src/libstd/sys_common/mod.rs#L124 | |
// Computes (value*numer)/denom without overflow, as long as both | |
// (numer*denom) and the overall result fit into i64 (which is the case | |
// for our time conversions). | |
int64_t int64MulDiv(int64_t value, int64_t numer, int64_t denom) { | |
int64_t q = value / denom; | |
int64_t r = value % denom; | |
// Decompose value as (value/denom*denom + value%denom), | |
// substitute into (value*numer)/denom and simplify. | |
// r < denom, so (denom*numer) is the upper bound of (r*numer) |
This file contains 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
# forays into | |
Perfect Spatial Hashing (Lefebvre & Hoppe) | |
http://hhoppe.com/perfecthash.pdf | |
how it works: | |
There are two parts: a slow encoding step, and a fast decoding step. | |
Encoding |
This file contains 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
// 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] |
This file contains 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
Setup: | |
1. Index buffer containing N quads (each 2 triangles), where N is the max amount of spheres. Repeating pattern of {0,1,2,1,3,2} + K*4. | |
2. No vertex buffer. | |
Render N*2 triangles, where N is the number of spheres you have. | |
Vertex shader: | |
1. Sphere index = N/4 (N = SV_VertexId) | |
2. Quad coord: Q = float2(N%2, (N%4)/2) * 2.0 - 1.0 | |
3. Transform sphere center -> pos |
Yesterday I posted a problem to math stack exchange that bothered me for a while now, and right after I've had a few exchanges on Twitter, I got inspired to attempt a solution.
Here it goes. It's 100% untested but I'm fairly certain that it will work.
The problem is about a form of refining raytracing where we render a big list of convex 3D brushes (and I decided to start with Ellipsoids, since they're so useful) to the screen or a shadow map, without any prebuilt accelleration structure. How does it work? Well, if we had a way to figure out for a portion of the frustum whether it contained a brush, we could
- Start with a very low resolution
NewerOlder