generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,086 additions
and
994 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// see https://github.com/bevyengine/bevy/blob/c1a4e29a1ec2b3a54fa0449ed28bb59ec00ac1ed/crates/bevy_pbr/src/render/pbr.wgsl | ||
|
||
#import bevy_pbr::{ | ||
pbr_functions::alpha_discard, | ||
pbr_fragment::pbr_input_from_standard_material, | ||
} | ||
|
||
#ifdef PREPASS_PIPELINE | ||
#import bevy_pbr::{ | ||
prepass_io::{VertexOutput, FragmentOutput}, | ||
pbr_deferred_functions::deferred_output, | ||
} | ||
#else | ||
#import bevy_pbr::{ | ||
forward_io::{VertexOutput, FragmentOutput}, | ||
pbr_functions::{apply_pbr_lighting, main_pass_post_lighting_processing}, | ||
pbr_types::STANDARD_MATERIAL_FLAGS_UNLIT_BIT, | ||
} | ||
#endif | ||
|
||
@fragment | ||
fn fragment( | ||
in: VertexOutput, | ||
@builtin(front_facing) is_front: bool, | ||
) -> FragmentOutput { | ||
// generate a PbrInput struct from the StandardMaterial bindings | ||
var pbr_input = pbr_input_from_standard_material(in, is_front); | ||
|
||
// alpha discard | ||
pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color); | ||
|
||
#ifdef PREPASS_PIPELINE | ||
// write the gbuffer, lighting pass id, and optionally normal and motion_vector textures | ||
let out = deferred_output(in, pbr_input); | ||
#else | ||
// in forward mode, we calculate the lit color immediately, and then apply some post-lighting effects here. | ||
// in deferred mode the lit color and these effects will be calculated in the deferred lighting shader | ||
var out: FragmentOutput; | ||
if (pbr_input.material.flags & STANDARD_MATERIAL_FLAGS_UNLIT_BIT) == 0u { | ||
out.color = apply_pbr_lighting(pbr_input); | ||
} else { | ||
out.color = pbr_input.material.base_color; | ||
} | ||
|
||
// apply in-shader post processing (fog, alpha-premultiply, and also tonemapping, debanding if the camera is non-hdr) | ||
// note this does not include fullscreen postprocessing effects like bloom. | ||
out.color = main_pass_post_lighting_processing(pbr_input, out.color); | ||
#endif | ||
|
||
return out; | ||
} |
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
1,998 changes: 1,014 additions & 984 deletions
1,998
src/main/gen/wgslplugin/language/_WgslLexer.java
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/main/gen/wgslplugin/language/psi/impl/WGSLIfStatementImpl.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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