Skip to main content

Crate soorat

Crate soorat 

Source
Expand description

Soorat — GPU rendering engine for AGNOS

Soorat (Arabic/Urdu: صورت — form, image, appearance) is a wgpu-based rendering engine designed for the Kiran game engine and AGNOS ecosystem.

§Modules

Re-exports§

pub use capabilities::SooratCapabilities;
pub use color::Color;
pub use color::visualization_heat_map;
pub use error::RenderError;
pub use error::Result;
pub use window::Window;
pub use window::WindowConfig;
pub use gpu_particles::GpuParticle;
pub use gpu_particles::GpuParticleSystem;
pub use gpu_particles::SimParams;
pub use lod::LodChain;
pub use lod::TerrainLod;
pub use render_graph::PassType;
pub use render_graph::RenderGraph;
pub use environment::EnvironmentMap;
pub use environment::IblBindGroup;
pub use fluid_render::FluidColorMode;
pub use fluid_render::ParticleColorParams;
pub use acoustic_render::AcousticColorMode;
pub use acoustic_render::AcousticVisParams;
pub use acoustic_render::DecayCurveParams;
pub use em_render::EmColorMode;
pub use em_render::EmVisParams;
pub use thermo_render::CycleDiagramParams;
pub use thermo_render::ThermalColorMode;
pub use thermo_render::ThermalVisParams;
pub use egui_bridge::ViewportSize;
pub use pipeline::FrameStats;
pub use pipeline::SpriteBuffers;
pub use pipeline::SpritePipeline;
pub use pipeline::batch_to_vertices;
pub use pipeline::batch_to_vertices_into;
pub use pipeline::batch_to_vertices_u32;
pub use sprite::Sprite;
pub use sprite::SpriteBatch;
pub use sprite::UvRect;
pub use texture::Texture;
pub use texture::TextureCache;
pub use mesh_pipeline::CameraUniforms;
pub use mesh_pipeline::DepthBuffer;
pub use mesh_pipeline::LightUniforms;
pub use mesh_pipeline::Mesh;
pub use mesh_pipeline::MeshPipeline;
pub use mesh_pipeline::ShadowPassUniforms;
pub use pbr_material::MaterialUniforms;
pub use lights::GpuLight;
pub use lights::LightArrayUniforms;
pub use shadow::CascadeUniforms;
pub use shadow::CascadedShadowMap;
pub use shadow::PointShadowMap;
pub use shadow::ShadowAtlas;
pub use shadow::ShadowAtlasConfig;
pub use shadow::ShadowMap;
pub use shadow::ShadowPipeline;
pub use shadow::ShadowUniforms;
pub use animation::AnimationClip;
pub use animation::JointUniforms;
pub use animation::Skeleton;
pub use debug_draw::LineBatch;
pub use debug_draw::LinePipeline;
pub use debug_draw::LineVertex;
pub use hdr::BloomPipeline;
pub use hdr::BloomUniforms;
pub use hdr::HdrFramebuffer;
pub use postprocess::PostProcessPipeline;
pub use postprocess::PostProcessUniforms;
pub use postprocess::ToneMapMode;
pub use ssao::SsaoPipeline;
pub use ssao::SsaoUniforms;
pub use screenshot::ScreenshotFormat;
pub use screenshot::capture_render_target;
pub use screenshot::encode_pixels;
pub use screenshot::save_to_file;
pub use terrain::TerrainConfig;
pub use terrain::TerrainData;
pub use text::BitmapFont;
pub use text::TextBatch;
pub use ui::UiBatch;
pub use ui::UiLabel;
pub use ui::UiPanel;
pub use material::Material;

Modules§

acoustic_render
Acoustic visualization — ray paths, pressure maps, room modes, portals, directivity balloons, and coupled decay curves.
animation
Skeletal animation — joints, skins, animation clips.
batch
Sprite batch → vertex/index generation.
capabilities
GPU capability reporting — feature detection and limit queries.
color
Color types and utilities.
compute
Compute shader pipeline — general-purpose GPU compute.
debug_draw
Debug line rendering pipeline and shape helpers.
drm
DRM device information — kernel-level GPU details.
egui_bridge
Egui integration helpers — bridge soorat render targets to egui textures.
em_render
Electromagnetism visualization — FDTD field heatmaps, field line traces, point charges, radiation patterns, and vector field arrows.
environment
Environment maps — cubemap textures for IBL (Image-Based Lighting).
error
Error types for soorat.
fluid_render
Fluid rendering — SPH particle visualization and shallow water surface meshes.
gltf_loader
glTF model loading.
gpu
GPU device and surface management.
gpu_particles
GPU particle system — compute shader simulation + instanced quad rendering.
hdr
HDR framebuffer and post-processing chain.
instancing
Per-instance rendering (transforms + color).
lights
Multi-light system — directional, point, and spot lights.
lod
Level of Detail — distance-based mesh/terrain selection.
material
Material types for 3D mesh rendering.
mesh_pipeline
3D mesh rendering pipeline.
pbr_material
PBR material types and BRDF LUT precomputation.
pipeline
Sprite rendering pipeline. Also re-exports batch functions from crate::batch for backward compatibility.
postprocess
Post-processing pipeline — tone mapping, bloom.
primitives
Built-in mesh primitives — cube, sphere, plane, cylinder. Generates Vertex3D + index data for common shapes without requiring glTF loading.
profiler
Frame profiling — CPU timing and GPU timestamp queries.
render_graph
Render graph — multi-pass abstraction for configurable render pipelines.
render_target
Offscreen render targets.
screenshot
Screenshot capture from GPU render targets via selah.
shadow
Shadow mapping for directional lights.
sprite
Sprite rendering types.
ssao
Screen-Space Ambient Occlusion (SSAO).
terrain
Terrain rendering — heightmap-based mesh generation.
text
Text rendering — bitmap font glyph atlas + text batching.
texture
Texture loading and management.
thermo_render
Thermodynamics visualization — thermal grid heatmaps, temperature profiles, cycle diagrams, thermal network graphs, and heat flux arrows.
ui
UI rendering — screen-space panels, labels, and HUD elements.
vertex
Vertex types and buffer layouts.
window
Window management via winit.

Structs§

ComputePipeline
A compute pipeline wrapping wgpu::ComputePipeline with bind group management.
CubemapTexture
A GPU cubemap texture (6 faces) with view and sampler.
FrameProfiler
Frame profiler — tracks CPU-side frame timing and GPU pass durations.
GpuCapabilities
GPU capabilities report — what the current device supports.
GpuContext
Holds the wgpu device, queue, adapter, and instance.
GpuContextBuilder
Builder for GPU context creation with custom configuration.
GpuTimestamps
GPU timestamp query set — wraps wgpu::QuerySet for per-pass GPU timing.
InstanceBuffer
Instance buffer — holds per-instance data on the GPU with dynamic growth.
InstanceData
Per-instance data: model matrix (column-major 4x4) + color tint.
PassTiming
Timing for a single render/compute pass.
PingPongBuffer
A double-buffer pair for iterative compute patterns (ping-pong).
ProfileScope
RAII timing scope — records elapsed time to a FrameProfiler on drop.
RenderTarget
An offscreen render target (framebuffer) that can be drawn to and read back.
RenderTargetBuilder
Builder for render targets with MSAA and/or depth attachments.
SkinnedVertex3D
A skinned 3D vertex with tangent, joint indices, and joint weights. Used for skeletal animation and normal-mapped meshes.
Vertex2D
A 2D vertex with position, texture coordinates, and color.
Vertex3D
A 3D vertex with position, normal, texture coordinates, and color.

Functions§

copy_texture_to_texture
Copy a region from one texture to another.
create_default_sampler
A shared sampler that can be reused across textures. Create once and pass to Texture::from_rgba_with_sampler to avoid per-texture sampler allocation.
mip_level_count
Calculate the number of mip levels for a texture of the given dimensions.
validate_dimensions
Validate texture dimensions against device limits.
validate_dispatch
Validate workgroup counts against device limits.
workgroups_1d
Calculate workgroup count for a 1D dispatch.
workgroups_2d
Calculate workgroup counts for a 2D dispatch.