-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 0dec46e 🚀
- Loading branch information
Showing
11 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,46 @@ | ||
#import bevy_pbr::{ | ||
pbr_fragment::pbr_input_from_standard_material, | ||
pbr_functions::alpha_discard, | ||
} | ||
|
||
#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}, | ||
} | ||
#endif | ||
|
||
struct MyExtendedMaterial { | ||
quantize_steps: u32, | ||
} | ||
|
||
@group(1) @binding(100) | ||
var<uniform> my_extended_material: MyExtendedMaterial; | ||
|
||
@fragment | ||
fn fragment( | ||
in: VertexOutput, | ||
@builtin(front_facing) is_front: bool, | ||
) -> FragmentOutput { | ||
var pbr_input = pbr_input_from_standard_material(in, is_front); | ||
|
||
if (in.world_normal.y < 0.8) { | ||
pbr_input.material.base_color.g /= 2.0; | ||
} | ||
|
||
pbr_input.material.base_color = alpha_discard(pbr_input.material, pbr_input.material.base_color); | ||
|
||
#ifdef PREPASS_PIPELINE | ||
let out = deferred_output(in, pbr_input); | ||
#else | ||
var out: FragmentOutput; | ||
out.color = main_pass_post_lighting_processing(pbr_input, apply_pbr_lighting(pbr_input)); | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
struct WaterMaerial { | ||
color: vec4<f32>, | ||
}; | ||
|
||
@group(1) @binding(0) | ||
var<uniform> material: WaterMaerial; | ||
@group(1) @binding(1) | ||
var base_color_texture: texture_2d<f32>; | ||
@group(1) @binding(2) | ||
var base_color_sampler: sampler; | ||
|
||
@fragment | ||
fn fragment( | ||
#import bevy_pbr::mesh_vertex_output | ||
) -> @location(0) vec4<f32> { | ||
return material.color * textureSample(base_color_texture, base_color_sampler, uv); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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,5 @@ | ||
# Credits | ||
|
||
## Assets | ||
|
||
* Bevy icon: [MIT License](licenses/Bevy_MIT_License.md); |
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,19 @@ | ||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
<!doctype html><html lang=en><meta charset=utf-8><title>Bevy hydrology</title><link href=icon.ico rel=icon><style>body,html{height:100%}body{background:#fff;margin:0}.game-container{justify-content:center;align-items:center;width:100%;height:100%;display:flex}#bevy{background-color:#fff;width:800px;height:600px}</style><link as=fetch crossorigin href=bevy-hydrology/bevy_hydrology-d84fda6fa6d1401e_bg.wasm integrity=sha384-FKsFOWwfYhRRoEuZdHlSsZcxYFGz2RHXK2FRmlTm9bjOvMJd_7dzXs3w9491WMqE rel=preload type=application/wasm><link crossorigin href=bevy-hydrology/bevy_hydrology-d84fda6fa6d1401e.js integrity=sha384-T6z4vXq2Rq6Dc_9UzaNtZJpVcOV76nY7yHTlN0arw_qSFgneXUmpptAzRaZEeWe- rel=modulepreload></head><body><script>(()=>{let d=0;var c=(e=>{let f=d;a.forEach(a=>{if(a.state!==`running`){a.resume()}else{f++}});if(f>d&&f===a.length){b.forEach(a=>{document.removeEventListener(a,c)})}});const a=[];const b=[`click`,`contextmenu`,`auxclick`,`dblclick`,`mousedown`,`mouseup`,`pointerup`,`touchend`,`keydown`,`keyup`];self.AudioContext=new Proxy(self.AudioContext,{construct(b,c){const d=new b(...c);a.push(d);return d}});b.forEach(a=>{document.addEventListener(a,c)})})()</script><div class=game-container><canvas id=bevy>Javascript and support for canvas is required</canvas></div><script type=module>import a,*as b from"bevy-hydrology/bevy_hydrology-d84fda6fa6d1401e.js";a(`bevy-hydrology/bevy_hydrology-d84fda6fa6d1401e_bg.wasm`);window.wasmBindings=b</script></body></html> |