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
// License: Apache-2.0 / MIT | |
// Bevy main 0.11 | |
use bevy::{asset::Asset, prelude::*, reflect::TypeUuid, utils::Uuid}; | |
///For automatically resizing an image relative to the viewport size | |
pub trait ImageUpdate { | |
fn update(&mut self, name: &Uuid, image_h: Handle<Image>); | |
} |
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
// License: Apache-2.0 / MIT | |
// Adapted from https://gist.github.com/IceSentry/3949ee344857c2745dc961a64e6fc28f | |
//! This example shows how to create a custom render pass that runs after the main pass | |
//! and reads the color texture generated by the main pass, and also the prepass textures. | |
//! | |
//! This is a fairly low level example and assumes some familiarity with rendering concepts and wgpu. | |
use bevy::{ | |
core_pipeline::{ |
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
fn cubic(v: f32) -> vec4<f32> { | |
let n = vec4(1.0, 2.0, 3.0, 4.0) - v; | |
let s = n * n * n; | |
let x = s.x; | |
let y = s.y - 4.0 * s.x; | |
let z = s.z - 4.0 * s.y + 6.0 * s.x; | |
let w = 6.0 - x - y - z; | |
return vec4(x, y, z, w) * (1.0/6.0); | |
} |
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
// Generate log2 LUT stimulus | |
// [dependencies] | |
// image = "0.24" | |
// glam = "0.22" | |
use glam::{vec3, Vec3}; | |
use image::{ImageBuffer, Rgb}; | |
extern crate image; |
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
// Convert 32bit, 16bit, or RGB9E5 images in 3D or vertical strip format | |
// to either 16bit or RGB9E5 KTX2 with ZSTD supercompression in 3D | |
// Example cargo run -- --inputs tony_mc_mapface.dds,blender_-11_12.exr,AgX-default_contrast.exr --outputs tony_mc_mapface.ktx2,blender_-11_12.ktx2,AgX-default_contrast.ktx2 | |
// [dependencies] | |
// Should be able to use bevy 0.10 instead when it is release. Needed for exr support. (TODO rewrite without bevy) | |
// bevy = { git = "https://github.com/DGriffin91/bevy", branch = "tonemap_options", features = ["zstd", "ktx2", "exr", "dds"] } | |
// half = { version = "2.1" } | |
// ktx2 = { git = "https://github.com/BVE-Reborn/ktx2", rev = "4a7cc48ffa4deb3aa1ef5b453292220489908fa1" } |
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
// for converting https://github.com/MrLixm/AgXc/blob/main/obs/obs-script/AgX-default_contrast.lut.png | |
// to a vertical exr | |
// [dependencies] | |
// image = "0.24" | |
// glam = "0.22" | |
use std::path::Path; | |
use image::{DynamicImage, GenericImage, GenericImageView, ImageBuffer, Rgb}; |
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
// License: Apache-2.0 / MIT | |
// Combine multiple meshes in Bevy with Transforms | |
// Adapted from https://github.com/bevyengine/bevy/blob/main/examples/3d/3d_shapes.rs | |
use std::f32::consts::PI; | |
use bevy::{ | |
math::Vec4Swizzles, | |
prelude::*, | |
render::{ |
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
Compiling invalid-bitcast v0.1.0 | |
Invalid bitcast | |
%38 = bitcast <2 x i32> %37 to <2 x i24> | |
Invalid bitcast | |
%40 = bitcast <2 x i32> %39 to <2 x i24> | |
in function _ZN4rkyv5impls4core89_$LT$impl$u20$rkyv..DeserializeUnsized$LT$$u5b$U$u5d$$C$D$GT$$u20$for$u20$$u5b$T$u5d$$GT$19deserialize_unsized17h8bf3deadc9a4552bE | |
LLVM ERROR: Broken function found, compilation aborted! | |
error: could not compile `invalid-bitcast` |
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
// License: Apache-2.0 / MIT | |
//camera controller from https://github.com/DGriffin91/bevy_basic_camera | |
use bevy::{ | |
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, | |
prelude::*, | |
render::render_resource::PrimitiveTopology, | |
}; | |
use bevy_basic_camera::{CameraController, CameraControllerPlugin}; |
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
// License: Apache-2.0 / MIT | |
use std::num::NonZeroU8; | |
use bevy::{ | |
asset::HandleId, | |
prelude::*, | |
render::{ | |
render_resource::{ | |
Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, |