mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
Explicitly using rgba8unorm format for rain pass render targets
This commit is contained in:
5
TODO.txt
5
TODO.txt
@@ -1,7 +1,10 @@
|
|||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
WebGPU
|
WebGPU
|
||||||
Get everything to load properly from gh pages
|
FF Nightly bugs
|
||||||
|
What's it warning about?
|
||||||
|
Why's it crashing?
|
||||||
|
Try https://github.com/brendan-duncan/wgsl_reflect
|
||||||
Get rid of end pass once it's possible to copy a bgra8unorm to a canvas texture
|
Get rid of end pass once it's possible to copy a bgra8unorm to a canvas texture
|
||||||
Switch to rgba32float somehow?
|
Switch to rgba32float somehow?
|
||||||
Why isn't this straightforward?
|
Why isn't this straightforward?
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const makeConfigBuffer = (device, configUniforms, config, density, gridSize) =>
|
|||||||
return makeUniformBuffer(device, configUniforms, configData);
|
return makeUniformBuffer(device, configUniforms, configData);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ({ config, device, timeBuffer, canvasFormat }) => {
|
export default ({ config, device, timeBuffer }) => {
|
||||||
const { mat4, vec3 } = glMatrix;
|
const { mat4, vec3 } = glMatrix;
|
||||||
|
|
||||||
const assets = [loadTexture(device, config.glyphTexURL), loadShader(device, "shaders/wgsl/rainPass.wgsl")];
|
const assets = [loadTexture(device, config.glyphTexURL), loadShader(device, "shaders/wgsl/rainPass.wgsl")];
|
||||||
@@ -60,6 +60,10 @@ export default ({ config, device, timeBuffer, canvasFormat }) => {
|
|||||||
}
|
}
|
||||||
const camera = mat4.create();
|
const camera = mat4.create();
|
||||||
|
|
||||||
|
// It's handy to have multiple channels, in case we have
|
||||||
|
// multiple varieties of code, such as downward and upward flowing
|
||||||
|
const renderFormat = "rgba8unorm";
|
||||||
|
|
||||||
const linearSampler = device.createSampler({
|
const linearSampler = device.createSampler({
|
||||||
magFilter: "linear",
|
magFilter: "linear",
|
||||||
minFilter: "linear",
|
minFilter: "linear",
|
||||||
@@ -122,14 +126,14 @@ export default ({ config, device, timeBuffer, canvasFormat }) => {
|
|||||||
entryPoint: "fragMain",
|
entryPoint: "fragMain",
|
||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
format: canvasFormat,
|
format: renderFormat,
|
||||||
blend: {
|
blend: {
|
||||||
color: additiveBlendComponent,
|
color: additiveBlendComponent,
|
||||||
alpha: additiveBlendComponent,
|
alpha: additiveBlendComponent,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: canvasFormat,
|
format: renderFormat,
|
||||||
blend: {
|
blend: {
|
||||||
color: additiveBlendComponent,
|
color: additiveBlendComponent,
|
||||||
alpha: additiveBlendComponent,
|
alpha: additiveBlendComponent,
|
||||||
@@ -160,10 +164,10 @@ export default ({ config, device, timeBuffer, canvasFormat }) => {
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
output?.destroy();
|
output?.destroy();
|
||||||
output = makeRenderTarget(device, size, canvasFormat);
|
output = makeRenderTarget(device, size, renderFormat);
|
||||||
|
|
||||||
highPassOutput?.destroy();
|
highPassOutput?.destroy();
|
||||||
highPassOutput = makeRenderTarget(device, size, canvasFormat);
|
highPassOutput = makeRenderTarget(device, size, renderFormat);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
primary: output,
|
primary: output,
|
||||||
|
|||||||
Reference in New Issue
Block a user