-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from AryanpurTech/FromOrdinaryToWonder
inline traits
- Loading branch information
Showing
13 changed files
with
2,550 additions
and
2,550 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
target | ||
.vscode | ||
tools | ||
res | ||
target | ||
.vscode | ||
tools | ||
res |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
<img src="https://raw.githubusercontent.com/AryanpurTech/BlueEngineDocs/master/resources/logo_3d.gif" loop=infinite width="100%" /> | ||
|
||
[![Rust Linux](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-linux.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-linux.yml) | ||
[![Rust Windows](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-win.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-win.yml) | ||
[![Rust MacOS](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-osx.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-osx.yml) | ||
|
||
Make sure to use latest Rust version, as the engine is always kept up to date. | ||
|
||
## About | ||
|
||
Blue Engine is a general-purpose, easy-to-use, extendable, and portable graphics engine written in rust. The engine can run on many popular back-end APIs including Vulkan, D3D-12, GL-ES 3, and Metal as well as Windows, Linux, Mobile, and OSX to ensure cross-platform compatibility. | ||
|
||
Hello World: | ||
|
||
```rust | ||
use blue_engine::{ | ||
header::{ Engine, ObjectSettings }, | ||
primitive_shapes::triangle | ||
}; | ||
|
||
fn main() { | ||
// initialize the engine | ||
let mut engine = Engine::new().expect("engine couldn't be initialized"); | ||
|
||
// create a triangle | ||
triangle("my triangle", ObjectSettings::default(), &mut engine.renderer, &mut engine.objects).unwrap(); | ||
|
||
// run the engine | ||
engine | ||
.update_loop(move |_, _, _, _, _, _| {}) | ||
.expect("Error during update loop"); | ||
} | ||
``` | ||
|
||
* [Join our discord server](https://discord.gg/s7xsj9q) | ||
|
||
* [WIP] [Guide](https://aryanpurtech.github.io/BlueEngineDocs/) | ||
|
||
* Check out the [workflow](https://github.com/orgs/AryanpurTech/projects/2) for roadmap, status, ... | ||
|
||
* Check out the [examples](https://github.com/AryanpurTech/BlueEngine/tree/master/examples) folder to get a sense of how things are done | ||
|
||
* Check out the [utilities library](https://github.com/AryanpurTech/BlueEngineUtilities) for extra functionality with the engine | ||
|
||
* Check out the [editor](https://github.com/rustylabs/blue_flame) | ||
|
||
*the credits to the image on top: NotPB* | ||
|
||
|
||
*the development might seem slow sometimes, its due to multiple repositories being handled and due to my education taking a large chunk of my time. The project isn't dead, just slow.* | ||
<img src="https://raw.githubusercontent.com/AryanpurTech/BlueEngineDocs/master/resources/logo_3d.gif" loop=infinite width="100%" /> | ||
|
||
[![Rust Linux](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-linux.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-linux.yml) | ||
[![Rust Windows](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-win.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-win.yml) | ||
[![Rust MacOS](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-osx.yml/badge.svg)](https://github.com/AryanpurTech/BlueEngine/actions/workflows/rust-osx.yml) | ||
|
||
Make sure to use latest Rust version, as the engine is always kept up to date. | ||
|
||
## About | ||
|
||
Blue Engine is a general-purpose, easy-to-use, extendable, and portable graphics engine written in rust. The engine can run on many popular back-end APIs including Vulkan, D3D-12, GL-ES 3, and Metal as well as Windows, Linux, Mobile, and OSX to ensure cross-platform compatibility. | ||
|
||
Hello World: | ||
|
||
```rust | ||
use blue_engine::{ | ||
header::{ Engine, ObjectSettings }, | ||
primitive_shapes::triangle | ||
}; | ||
|
||
fn main() { | ||
// initialize the engine | ||
let mut engine = Engine::new().expect("engine couldn't be initialized"); | ||
|
||
// create a triangle | ||
triangle("my triangle", ObjectSettings::default(), &mut engine.renderer, &mut engine.objects).unwrap(); | ||
|
||
// run the engine | ||
engine | ||
.update_loop(move |_, _, _, _, _, _| {}) | ||
.expect("Error during update loop"); | ||
} | ||
``` | ||
|
||
* [Join our discord server](https://discord.gg/s7xsj9q) | ||
|
||
* [WIP] [Guide](https://aryanpurtech.github.io/BlueEngineDocs/) | ||
|
||
* Check out the [workflow](https://github.com/orgs/AryanpurTech/projects/2) for roadmap, status, ... | ||
|
||
* Check out the [examples](https://github.com/AryanpurTech/BlueEngine/tree/master/examples) folder to get a sense of how things are done | ||
|
||
* Check out the [utilities library](https://github.com/AryanpurTech/BlueEngineUtilities) for extra functionality with the engine | ||
|
||
* Check out the [editor](https://github.com/rustylabs/blue_flame) | ||
|
||
*the credits to the image on top: NotPB* | ||
|
||
|
||
*the development might seem slow sometimes, its due to multiple repositories being handled and due to my education taking a large chunk of my time. The project isn't dead, just slow.* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
// Vertex Stage | ||
|
||
[[block]] | ||
struct VertexUniforms { | ||
camera_matrix: mat4x4<f32>; | ||
}; | ||
[[group(1), binding(0)]] | ||
var<uniform> vertex_uniforms: VertexUniforms; | ||
|
||
struct VertexInput { | ||
[[location(0)]] position: vec3<f32>; | ||
[[location(1)]] texture_coordinates: vec2<f32>; | ||
}; | ||
|
||
struct VertexOutput { | ||
[[builtin(position)]] position: vec4<f32>; | ||
[[location(0)]] texture_coordinates: vec2<f32>; | ||
}; | ||
|
||
[[stage(vertex)]] | ||
fn main(input: VertexInput) -> VertexOutput { | ||
var out: VertexOutput; | ||
out.position = vertex_uniforms.camera_matrix * vec4<f32>(input.position, 1.0); | ||
out.texture_coordinates = input.texture_coordinates; | ||
return out; | ||
} | ||
|
||
// Fragment Stage | ||
|
||
[[block]] | ||
struct FragmentUniforms { | ||
color: vec4<f32>; | ||
}; | ||
[[group(1), binding(1)]] | ||
var<uniform> fragment_uniforms: FragmentUniforms; | ||
|
||
[[group(0), binding(0)]] | ||
var texture_diffuse: texture_2d<f32>; | ||
|
||
[[group(0), binding(1)]] | ||
var sampler_diffuse: sampler; | ||
|
||
[[stage(fragment)]] | ||
fn main(input: VertexOutput) -> [[location(0)]] vec4<f32> { | ||
return textureSample(texture_diffuse, sampler_diffuse, input.texture_coordinates) * fragment_uniforms.color; | ||
// Vertex Stage | ||
|
||
[[block]] | ||
struct VertexUniforms { | ||
camera_matrix: mat4x4<f32>; | ||
}; | ||
[[group(1), binding(0)]] | ||
var<uniform> vertex_uniforms: VertexUniforms; | ||
|
||
struct VertexInput { | ||
[[location(0)]] position: vec3<f32>; | ||
[[location(1)]] texture_coordinates: vec2<f32>; | ||
}; | ||
|
||
struct VertexOutput { | ||
[[builtin(position)]] position: vec4<f32>; | ||
[[location(0)]] texture_coordinates: vec2<f32>; | ||
}; | ||
|
||
[[stage(vertex)]] | ||
fn main(input: VertexInput) -> VertexOutput { | ||
var out: VertexOutput; | ||
out.position = vertex_uniforms.camera_matrix * vec4<f32>(input.position, 1.0); | ||
out.texture_coordinates = input.texture_coordinates; | ||
return out; | ||
} | ||
|
||
// Fragment Stage | ||
|
||
[[block]] | ||
struct FragmentUniforms { | ||
color: vec4<f32>; | ||
}; | ||
[[group(1), binding(1)]] | ||
var<uniform> fragment_uniforms: FragmentUniforms; | ||
|
||
[[group(0), binding(0)]] | ||
var texture_diffuse: texture_2d<f32>; | ||
|
||
[[group(0), binding(1)]] | ||
var sampler_diffuse: sampler; | ||
|
||
[[stage(fragment)]] | ||
fn main(input: VertexOutput) -> [[location(0)]] vec4<f32> { | ||
return textureSample(texture_diffuse, sampler_diffuse, input.texture_coordinates) * fragment_uniforms.color; | ||
} |
Oops, something went wrong.