Skip to content

Instantly share code, notes, and snippets.

View edap's full-sized avatar

Davide Prati edap

View GitHub Profile
@edap
edap / example.js
Created April 20, 2017 12:05
load .ply files exported from magicavoxel into threejs
//THREE.PLYLoader returns a BufferGeometry
createMesh(buffGeometry){
let geometry = new THREE.Geometry().fromBufferGeometry( buffGeometry );
var material = new THREE.MeshPhongMaterial( { specular: 0x111111, shininess: 200, vertexColors: THREE.VertexColors } );
var mesh = new THREE.Mesh( geometry, material );
mesh.scale.multiplyScalar( 0.5 );
return mesh;
}
// A demonstration of drawing to a very large texture, capturing the texture in its original size
// as a PNG and displaying a down-scaled version of the image within the window each frame.
use nannou::prelude::*;
fn main() {
nannou::app(model).update(update).run();
}
struct Model {
@edap
edap / sampling_multisampled_2dtexture.wgsl
Created March 17, 2022 08:04
Sampling multisampled 2d texture
struct FragmentOutput {
[[location(0)]] out_color: vec4<f32>;
};
[[block]]
struct Data {
time: f32;
};
[[group(0), binding(0)]]
@edap
edap / Shadow.cs
Created May 9, 2024 15:19 — forked from tattyd/Shadow.cs
Soft shadow control for Unity UI Toolkit
/* MIT License
Copyright (c) 2022 David Tattersall
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: