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
- Core:
gpu,window,color,vertex,error,profiler,capabilities - 2D:
pipeline(sprites),sprite,texture,text,ui - 3D:
mesh_pipeline(PBR),shadow,animation,terrain,primitives - Lighting:
lights,environment(IBL) - Post-processing:
postprocess,hdr(bloom),ssao - Debug:
debug_draw(wireframe lines, shapes, grid) - Rendering:
instancing,lod,compute,gpu_particles,render_graph - Fluids:
fluid_render(pravash integration) - Acoustics:
acoustic_render(goonj integration — ray paths, pressure maps, directivity) - Electromagnetism:
em_render(bijli integration — FDTD heatmaps, field lines, charges, radiation) - Thermodynamics:
thermo_render(ushma integration — thermal grids, profiles, cycles, flux) - Screenshot:
screenshot(selah integration — capture, annotate, redact) - Loading:
gltf_loader,texture - Integration:
egui_bridge(salai editor)
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::batchfor 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§
- Compute
Pipeline - A compute pipeline wrapping
wgpu::ComputePipelinewith bind group management. - Cubemap
Texture - A GPU cubemap texture (6 faces) with view and sampler.
- Frame
Profiler - 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.
- GpuContext
Builder - Builder for GPU context creation with custom configuration.
- GpuTimestamps
- GPU timestamp query set — wraps
wgpu::QuerySetfor per-pass GPU timing. - Instance
Buffer - Instance buffer — holds per-instance data on the GPU with dynamic growth.
- Instance
Data - Per-instance data: model matrix (column-major 4x4) + color tint.
- Pass
Timing - Timing for a single render/compute pass.
- Ping
Pong Buffer - A double-buffer pair for iterative compute patterns (ping-pong).
- Profile
Scope - RAII timing scope — records elapsed time to a
FrameProfileron drop. - Render
Target - An offscreen render target (framebuffer) that can be drawn to and read back.
- Render
Target Builder - Builder for render targets with MSAA and/or depth attachments.
- Skinned
Vertex3D - 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_samplerto 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.