Skip to content

Instantly share code, notes, and snippets.

View StarArawn's full-sized avatar
🎯
Focusing

John StarArawn

🎯
Focusing
View GitHub Profile
@StarArawn
StarArawn / bevy_render_resources.rs
Last active March 27, 2021 15:11
Bevy Render Resources temp docs
// In bevy there are the following macros/derive traits:
// RenderResources, RenderResource, render_resources
// These allow you to link data from bevy to your shader directly.
//
// Struct data is linked to the shader via a naming convention.
//
// render_resources allows you to specify some specifics:
// from_self - Specifies that the following struct is a single binding.
// buffer - Specifies the following field is a uniform Buffer
// ignore - Ignores the following field and wont be sent to the GPU
[src/graphics/mesh.rs:230] &sub_mesh.vertices.iter().map(|x|
(x.normal,
x.tangent)).collect::<Vec<(Vec3, Vec4)>>() = [
(
Matrix {
data: [
-0.0,
-1.0,
0.0,
],
impl<B> SimpleGraphicsPipelineDesc<B, Game<B>> for SpriteBatchPassDesc
where B: gfx_hal::Backend,
{
type Pipeline = SpriteBatchPass<B>;
fn depth_stencil(&self) -> Option<gfx_hal::pso::DepthStencilDesc> {
None
}
fn vertices(&self) -> Vec<(
use rendy::{
command::{RenderPassInlineEncoder},
factory::{Config, Factory},
graph::{Graph, GraphBuilder, render::RenderPass, present::PresentNode, NodeBuffer, NodeImage},
memory::MemoryUsageValue,
mesh::{AsVertex, PosColor},
shader::{Shader, StaticShaderInfo, ShaderKind, SourceLanguage},
resource::buffer::Buffer,
};
@StarArawn
StarArawn / index.js
Created October 14, 2014 16:23
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@StarArawn
StarArawn / index.js
Created October 14, 2014 16:23
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@StarArawn
StarArawn / index.js
Created October 14, 2014 16:23
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
@StarArawn
StarArawn / index.js
Created October 14, 2014 16:22
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")