Runtime target textures seem to need to be the same format as the canvas current texture. Requires additional investigation.

Created a computeToTexture shader to experiment with writing directly to textures as a means of performing post processing.
This commit is contained in:
Rezmason
2021-11-03 09:03:05 -07:00
parent 35afa7ca01
commit 7eab0fd654
4 changed files with 58 additions and 27 deletions

View File

@@ -13,5 +13,5 @@ struct VertOutput {
}
[[stage(fragment)]] fn fragMain(input : VertOutput) -> [[location(0)]] vec4<f32> {
return textureSample(inputTexture, inputSampler, input.uv);
return textureSample(inputTexture, inputSampler, vec2<f32>(input.uv.x, 1.0 - input.uv.y));
}