Skip to content

Instantly share code, notes, and snippets.

View cessen's full-sized avatar

Nathan Vegdahl cessen

View GitHub Profile
@cessen
cessen / gist:496fa51132325581c4d1112c9e878326
Created April 2, 2016 08:47
Warnings in appleseed master from g++ 5.2.1
In file included from /home/cessen/Projects/appleseed/appleseed/src/appleseed/foundation/math/bvh.h:36:0,
from /home/cessen/Projects/appleseed/appleseed/src/appleseed/renderer/kernel/intersection/curvetree.h:42,
from /home/cessen/Projects/appleseed/appleseed/src/appleseed/renderer/kernel/intersection/assemblytree.h:34,
from /home/cessen/Projects/appleseed/appleseed/src/appleseed/renderer/kernel/intersection/assemblytree.cpp:31:
/home/cessen/Projects/appleseed/appleseed/src/appleseed/foundation/math/bvh/bvh_intersector.h: In member function ‘void foundation::bvh::Intersector<Tree, Visitor, Ray, StackSize, N>::intersect_no_motion(const Tree&, const RayType&, const RayInfoType&, Visitor&) const [with Tree = renderer::CurveTree; Visitor = renderer::CurveLeafVisitor; Ray = foundation::Ray<float, 3ul>; long unsigned int StackSize = 64ul; long unsigned int N = 3ul; foundation::bvh::Intersector<Tree, Visitor, Ray, StackSize, N>::RayType = foundation::Ray<float, 3ul>;
@cessen
cessen / smith_ropey_update.patch
Created January 3, 2018 06:57
Update Smith to latest Ropey.
diff --git a/Cargo.toml b/Cargo.toml
index d402e09..70043be 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,5 +9,5 @@ license = "MIT"
[dependencies]
clipboard = "0.1.2"
-ropey = "0.3.0"
+ropey = "0.5"
@cessen
cessen / Rust2018_post.md
Last active January 26, 2018 22:33
#Rust2018 blog post

#Rust2018

This is my contribution to the call for Rust blog posts.

I've been using Rust for various personal projects for quite a while now, and I confess that I have a lot to say about it! In fact, I've already said quite a bit about it before.

My experience with Rust has been overwhelmingly positive, and most of the things I still want (e.g. NLL, const functions, const generic parameters, SIMD intrinsics, etc.) are already well known and being worked on, so it seems silly to repeat them. Therefore, in this post I'm just going to highlight three small-ish things that have been mildly frustrating to me over the last year, but which I haven't seen mentioned recently.

BidirectionalIterator trait

@cessen
cessen / fluv32.rs
Last active December 8, 2020 23:13
FLuv32 encoding/decoding
//! This code is licensed under CC0
//! https://creativecommons.org/publicdomain/zero/1.0/
//! Encoding/decoding for the 32-bit FLuv32 color format.
//!
//! This encoding is based on, but is slightly different than, the 32-bit
//! LogLuv format from the paper "Overcoming Gamut and Dynamic Range
//! Limitations in Digital Images" by Greg Ward:
//!
//! * It uses the same uv chroma storage approach, but with *very* slightly
@cessen
cessen / helix_notes.md
Last active March 9, 2024 15:19
Helix notes

My personal notes on using Helix

I've started using Helix as my main editor, and I wanted a place to jot down notes as I run into things. So this is that spot. For anyone stumbling on this, please keep in mind that over-all I'm really liking Helix, which isn't well reflected in the notes below.

Please, no comments here

Please don't add comments to this gist. I do want to discuss these items, but not here. This is just a place for my personal notes, to help me keep track of my thoughts. (Unfortunately, Github doesn't support disabling comments on gists.)

If you're reading this and want to comment on something, feel free to open up an issue on the Helix repo if it's significant enough, or just ping me in the Helix matrix room otherwise.

// This implementation is written for clarity rather than for performance
// or memory footprint. Possible optimizations include:
//
// - Storing the table with bit-packing, reducing its size to 24 bytes.
// - Inlining the hash into the scramble functions to remove
// redundant seed manipulations.
// - Using the iteration of the scramble process itself to randomize things
// with fewer hashing rounds.
// - Using SIMD to compute multiple scrambles at once.
// - Etc.
@cessen
cessen / sobol_burley.h
Last active August 11, 2022 13:04
Implementation of the Sobol-Burley sampler for Cycles.
/* SPDX-License-Identifier: Apache-2.0
* Copyright 2011-2022 Blender Foundation */
/*
* A shuffled, Owen-scrambled Sobol sampler, implemented with the
* techniques from the paper "Practical Hash-based Owen Scrambling"
* by Brent Burley, 2020, Journal of Computer Graphics Techniques.
*
* Note that unlike a standard high-dimensional Sobol sequence, this
* Sobol sampler uses padding to achieve higher dimensions, as described
@cessen
cessen / gist:a5985f42b7b2bd2fbb1f8a1d01e2a19f
Created September 28, 2022 22:58
Compile error in Blender from c55d38f00b8c0e6ae8bda9cc66614afe28fb3fc9
In file included from /home/cessen/Projects/blender-git/blender/source/blender/editors/space_view3d/view3d_draw.cc:23:
/home/cessen/Projects/blender-git/blender/source/blender/blenkernel/BKE_customdata.h:459:13: warning: redundant redeclaration of ‘const char* CustomData_get_render_layer_name(const CustomData*, int)’ in same scope [-Wredundant-decls]
459 | const char *CustomData_get_render_layer_name(const struct CustomData *data, int type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cessen/Projects/blender-git/blender/source/blender/blenkernel/BKE_customdata.h:453:13: note: previous declaration of ‘const char* CustomData_get_render_layer_name(const CustomData*, int)’
453 | const char *CustomData_get_render_layer_name(const struct CustomData *data, int type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cessen/Projects/blender-git/blender/source/blender/editors/space_view3d/view3d_draw.cc: In function ‘void draw_selected_name(const View3D*, Scene*, ViewLayer*, Object*, int, i