Crates.io | forte_engine |
lib.rs | forte_engine |
version | 0.2.3 |
source | src |
created_at | 2024-01-11 21:15:31.788818 |
updated_at | 2024-02-19 16:13:15.513314 |
description | A core for a basic render/game engine designed to have little overhead. |
homepage | |
repository | |
max_upload_size | |
id | 1096778 |
size | 303,025 |
A basic WGPU render engine designed to have a very small amount of overhead. In the future, this will serve as a base for other Forte Engine related modules.
Extensions for cgmath
to make our lives easier. For example, Quaternion::euler_deg_x(angle: f32)
allows us to quickly create quaternions with a angle around the x axis.
The basic render engine. This handles everything from creating the app and window, to handling inputs, to rendering mesh. See below for examples.
This module handles the basic information needed for lights. See examples below.
This contains the information of the camera.
Struct arguments:
struct CameraUniform {
view_pos: vec4<f32>,
view_proj: mat4x4<f32>,
};
@group(0) @binding(0)
var<uniform> camera: CameraUniform;
The texture to render with.
Binding 0: The texture itself. Binding 1: The sampler that will be used to "sample" the texture according to WGPU specs.
@group(1) @binding(0)
var t_diffuse: texture_2d<f32>;
@group(1) @binding(1)
var s_diffuse: sampler;
This is the basic information required for lights in a scene. You may wish to tweak what lights are passed to the shader based on their distances to the player.
Struct arguments:
struct Light {
position: vec3<f32>,
range: f32,
color: vec3<f32>,
exponent: f32,
direction: vec3<f32>,
cutoff: f32
}
@group(2) @binding(0)
var<storage, read_write> lights: array<Light>;
@group(2) @binding(1)
var<uniform> num_lights: u32;
@group(2) @binding(2)
var<uniform> ambient_light: vec3<f32>;