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)]]