Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

ChangeCaps/bevy-shadows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy shadow

Simply adds shadows to directional lights in the bevy engine.

Usage

To use simply add ShadowPlugin to your app and Shadowless to anything that shouldn't cast a shadow.

Configuration

For configuration there are several options in the plugin.

pub struct ShadowPlugin {
    /// Resolution of directional light shadow maps.
    pub directional_light_resolution: u32,
    /// If true, replaces the default pbr pipeline.
    /// If false use [`prelude::SHADOW_PBR_PIPELINE`].
    pub replace_pbr_pipeline: bool,
    /// If false, the shadow pbr pipeline won't be created.
    /// Disable if you want to implement your own.
    pub create_pbr_pipeline: bool,
    /// If false then the shadow pass won't be connected to main pass.
    pub connect_to_main_pass: bool,
}

There is also a configuration component for every light, that can optionally be inserted.

pub struct ShadowDirectionalLight {
    /// Size of the area covered by the light. 
    /// Everything outside will be lit by default.
    pub size: f32,
    /// Near plane of projection.
    pub near: f32,
    /// Far plane of projection.
    pub far: f32,
}

Compatibility

Currently only targets main.

About

shadows for the bevy game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published