examples: add cubemap example (#523)

Co-authored-by: Scott Johnson <scott.johnson@furniturerow.com>
This commit is contained in:
NewbLuck 2022-09-09 23:41:24 -06:00 committed by GitHub
parent 70f4514c66
commit f15cea9492
Failed to generate hash of commit
7 changed files with 443 additions and 0 deletions

View 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);
}