Skip to content

Instantly share code, notes, and snippets.

View Nyrox's full-sized avatar
🏃‍♀️
coding fast boii

Mark-Oliver Junge Nyrox

🏃‍♀️
coding fast boii
View GitHub Profile
vec3 sundir;
vec3 I_R, I_M;
vec2 totalDepthRM;
// consts
const vec3 rayScatterCoeff = vec3(58e-7, 135e-7, 331e-7);
const vec3 rayEffectiveCoeff = rayScatterCoeff; // Rayleight doesn't absorb light
const vec3 mieScatterCoeff = vec3(2e-5);
Constant buffer:
[6, 20, 20, 12, 0, 2, 0]
Variable Slots:
{}
Instruction block:
main
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const main = {
entry: ['./source/main.js', './assets/styles/main.scss'],
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist")
},
resolve: {
/* tslint:disable */
var wasm;
const TextDecoder = require('util').TextDecoder;
let cachedDecoder = new TextDecoder('utf-8');
let cachegetUint8Memory = null;
function getUint8Memory() {
if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) {
cachegetUint8Memory = new Uint8Array(wasm.memory.buffer);
@Nyrox
Nyrox / b.rs
Created September 27, 2018 20:36
pub fn render_tiled(scene: Scene, settings: Settings) -> TaskHandle {
let queue = Arc::new(MsQueue::new());
let (sender, receiver) = mpsc::channel();
// Split the backbuffer into tiles and push them into the queue
{
let mut x = 0;
let mut y = 0;
'gen_tiles: loop {
pub fn render_tiled(scene: Scene, settings: Settings) -> mpsc::Receiver<super::Tile> {
let queue = Arc::new(MsQueue::new());
let (sender, receiver) = mpsc::channel();
// Split the backbuffer into tiles and push them into the queue
{
let mut x = 0;
let mut y = 0;
'gen_tiles: loop {
pub fn launch_tiled<C: 'static + Clone + Sync + Send + Fn(super::Tile)>(
self,
scene: Scene,
tile_size: (usize, usize),
cb: C,
) -> () {
let queue = Arc::new(MsQueue::new());
// Generate tiles
{
@Nyrox
Nyrox / nn.rs
Last active May 24, 2018 12:15
extern crate rand;
use rand::Rng;
const TRAINING_SET_SIZE: u64 = 1024;
fn transfer_derivative(output: f64) -> f64 {
return output * (1.0 - output);
}
#[derive(Clone, Debug)]
struct ParseVisitor<T> {
_marker: PhantomData<T>
}
impl<'de, T> Visitor<'de> for ParseVisitor<T>
where T: std::str::FromStr
{
type Value = T;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
/*
Given two strings, find the number of common characters between them.
Example
For s1 = "aabcc" and s2 = "adcaa", the output should be
commonCharacterCount(s1, s2) = 3.
Strings have 3 common characters - 2 "a"s and 1 "c".
*/