examples: add cubemap example (#523)
Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
This commit is contained in:
parent
70f4514c66
commit
f15cea9492
7 changed files with 443 additions and 0 deletions
11
examples/cubemap/frag.wgsl
Normal file
11
examples/cubemap/frag.wgsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@group(0) @binding(1) var mySampler: sampler;
|
||||
@group(0) @binding(2) var myTexture: texture_cube<f32>;
|
||||
|
||||
@fragment
|
||||
fn main(
|
||||
@location(0) fragUV: vec2<f32>,
|
||||
@location(1) fragPosition: vec4<f32>
|
||||
) -> @location(0) vec4<f32> {
|
||||
var cubemapVec = fragPosition.xyz - vec3<f32>(0.5, 0.5, 0.5);
|
||||
return textureSample(myTexture, mySampler, cubemapVec);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue