mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
The texture sampler should operate linearly
This commit is contained in:
1
TODO.txt
1
TODO.txt
@@ -3,6 +3,7 @@ TODO:
|
||||
WebGPU
|
||||
First decent rainRender
|
||||
vertex, fragment, with noise for
|
||||
data texture lookup with textureLoad
|
||||
std140
|
||||
Document and share it
|
||||
|
||||
|
||||
@@ -68,7 +68,11 @@ export default async (canvas, config) => {
|
||||
],
|
||||
};
|
||||
|
||||
const sampler = device.createSampler();
|
||||
const msdfSampler = device.createSampler({
|
||||
magFilter: "linear",
|
||||
minFilter: "linear",
|
||||
});
|
||||
|
||||
const msdfTexture = await loadTexture(device, config.glyphTexURL);
|
||||
|
||||
const configStructLayout = std140(["i32", "i32", "f32"]);
|
||||
@@ -176,7 +180,7 @@ export default async (canvas, config) => {
|
||||
},
|
||||
{
|
||||
binding: 2,
|
||||
resource: sampler,
|
||||
resource: msdfSampler,
|
||||
},
|
||||
{
|
||||
binding: 3,
|
||||
|
||||
@@ -42,4 +42,8 @@ Bind groups let you bind a bunch of resources at once
|
||||
Render bundles let you reissue commands
|
||||
|
||||
You can only use up to FOUR bind groups on your laptop's device!
|
||||
Here's an annoying gotcha: uniform buffers are like classic UBOs, and have esoteric ("std140") layout requirements!
|
||||
Here's an annoying gotcha: uniform buffers are like classic UBOs, and have esoteric ("std140") layout requirements!
|
||||
|
||||
Texture lookup in vertex shader
|
||||
You can only sample textures in fragment stages
|
||||
But you can use textureLoad anywhere to get a specific texel, no sampler needed
|
||||
|
||||
Reference in New Issue
Block a user