Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View raggi's full-sized avatar

James Tucker raggi

View GitHub Profile
@h3r2tic
h3r2tic / raymarch.hlsl
Last active March 7, 2024 18:56
Depth buffer raymarching for contact shadows, SSGI, SSR, etc.
// Copyright (c) 2023 Tomasz Stachowiak
//
// This contribution is dual licensed under EITHER OF
//
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
// MIT license (http://opensource.org/licenses/MIT)
//
// at your option.
#include "/inc/frame_constants.hlsl"
func checksumNoFoldTwoAccum(b []byte, initial uint64) uint64 {
ac := initial
var bc, bcarr uint64
var carry uint64
for len(b) >= 128 {
// add in chunks of eight up to 128
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[:8]), carry)
bc, bcarr = bits.Add64(bc, binary.BigEndian.Uint64(b[8:16]), bcarr)
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[16:24]), carry)
bc, bcarr = bits.Add64(bc, binary.BigEndian.Uint64(b[24:32]), bcarr)
func checksumNoFoldBy8s(b []byte, initial uint64) uint64 {
ac := initial
var carry uint64
for len(b) >= 128 {
// add in chunks of eight up to 128
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[:8]), carry)
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[8:16]), carry)
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[16:24]), carry)
ac, carry = bits.Add64(ac, binary.BigEndian.Uint64(b[24:32]), carry)

Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.

Routing

Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.

The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.

If you have already modeled your application state using Ember.StateManager, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.