forked from PrismarineJS/prismarine-web-client
-
Notifications
You must be signed in to change notification settings - Fork 57
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
2 changed files
with
9 additions
and
25 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 |
---|---|---|
@@ -1,25 +1,12 @@ | ||
@group(0) @binding(1) var mySampler: sampler; | ||
@group(0) @binding(2) var myTexture: texture_2d<f32>; | ||
@group(0) @binding(5) var<uniform> tileSize: vec2<f32>; | ||
|
||
@fragment | ||
fn main( | ||
@location(0) fragUV: vec2f, | ||
@location(2) @interpolate(flat) ColorBlend: vec3f, | ||
@location(3) @interpolate(flat) ChunkOpacity: f32 | ||
@location(1) @interpolate(flat) ColorBlend: vec4f, | ||
) -> @location(0) vec4f { | ||
let pixelColor = textureSample(myTexture, mySampler, fragUV); | ||
// return vec4f(pixelColor.rgb * ColorBlend / 255, pixelColor.a); // Set alpha to 1.0 for full opacity | ||
return vec4f(pixelColor.rgb * ColorBlend / 255, 1.0 * ChunkOpacity); // Set alpha to 1.0 for full opacity | ||
// only gray: | ||
// let t = textureSample(myTexture, mySampler, fragUV / tilesPerTexture + vec2f(trunc(TextureIndex % tilesPerTexture.y), trunc(TextureIndex / tilesPerTexture.x)) / tilesPerTexture); | ||
// // return vec4f(pixelColor.rgb * ColorBlend / 255, pixelColor.a); // Set alpha to 1.0 for full opacity | ||
|
||
// if (abs(t.x-t.y) <=0.03 || abs(t.x-t.z)<=0.03 ||abs(t.y-t.z) <=0.03) | ||
// { | ||
// return vec4f(t.rgb * ColorBlend / 255, 1.0); | ||
// } | ||
// else { | ||
// return vec4f(t.rgb, 1.0); | ||
// } | ||
return vec4f(pixelColor.rgb, 1.0) * ColorBlend; // Set alpha to 1.0 for full opacity | ||
} |
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