const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;
float PHI = (1.0+sqrtf(5.0))/2.0;
cam.setPosition( cam.getPosition()+(targetPos-cam.getPosition())*0.01 );
cam.lookAt(targetPos);
In PIX, Select Target Process => Launch Win32 and set the following 2 entries according to where Canary / Chrome is installed:
- Path to executable: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
- Working directory: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application"
- Command line arguments: --disable-gpu-sandbox --disable-direct-composition
- You can add those arguments if you want to be able to see the disassembled shader code: --enable-dawn-features=emit_hlsl_debug_symbols,disable_symbol_renaming
- Launch Suspended unchecked, Launch for GPU capture and Force D3D11On12 checked
Then click on "Launch".
Important: you should close all your Canary / Chrome windows/processes before clicking on the "Launch" button!
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
<html> | |
<head> | |
<style> | |
body { | |
margin: 0; | |
padding: 10px; | |
color: #ffffff; | |
background: #222222; | |
font-family: sans-serif; | |
font-size: 7px; |
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
/** Using a faux sphere in screen space, determine the arc transform to orbit | |
* the camera around a target position. A continuous orientation will | |
* be provided for further calls. | |
*/ | |
function arcBallTransform( | |
scrSize, // Screen size, vec2 | |
scrPos0, // Starting mouse position, vec2 | |
scrPos1, // Ending Mouse Positiong, vec2 | |
rotOrientation, // Current arc orientation, quaternion | |
targetPos, // Position to orbit around |
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
// 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" |
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 time | |
import math | |
import torch | |
import taichi as ti | |
import taichi.math as tm | |
import tinytex as ttex | |
from tinycio import fsio |
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
// each pixel is assigned 4 random u32 values per frame | |
@group(0) @binding(1) | |
var<storage, read> rnd_state: array<u32>; | |
// the current state within this pixel | |
var<private> local_rnd_state:vec4u; | |
fn random_u32(state:ptr<private,vec4u>) -> u32 { | |
var st:vec4u = *state; | |
/* Algorithm "xor128" from p. 5 of Marsaglia, "Xorshift RNGs" */ |
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
// MIT License | |
// Copyright (c) 2024 Nathan V. Morrical | |
// 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 | |
// furnished to do so, subject to the following conditions: |
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
// Rounds up to the next nearest power-of-two value | |
static inline unsigned int pow2_ceil( unsigned int x ) { | |
#if defined( __clang__ ) || defined( __GNUC__ ) | |
return 1 + ( ( x >= 2 ) * ( ( ( 1u << 31 ) >> ( __builtin_clz( ( x - 1 ) | 1 ) - 1 ) ) - 1 ) ); | |
#elif defined( _MSC_VER ) && ( defined( _M_IX86 ) || defined( _M_X64 ) ) | |
return ( 1u << 31 ) >> ( __lzcnt( ( x - 1 ) | ( x == 0 ) ) - 1 ); | |
#elif defined( _MSC_VER ) && ( defined( _M_ARM ) || defined( _M_ARM64 ) ) | |
return ( 1u << 31 ) >> ( __clz( ( x - 1 ) | ( x == 0 ) ) - 1 ); | |
#else | |
--x; // if x is already pow2, we don't want the next pow2 |
OlderNewer