Skip to content

Commit 89b034b

Browse files
committed
rename things
1 parent 3d9a1f6 commit 89b034b

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

lib/playground/src/pages/gpgpu/boids (static).astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Layout from "../../layouts/Layout.astro";
2626
uCohesionWeight: 0.8,
2727
uBorderForce: 1,
2828
uBorderDistance: 0.8,
29-
tPositions: () => positions.outputTexture,
29+
tPositions: () => positions.texture,
3030
},
3131
dataTexture: {
3232
name: "tVelocities",
@@ -43,7 +43,7 @@ import Layout from "../../layouts/Layout.astro";
4343
fragment: boidsPositions,
4444
uniforms: {
4545
uDeltaTime: 0,
46-
tVelocities: () => velocities.outputTexture,
46+
tVelocities: () => velocities.texture,
4747
},
4848
dataTexture: {
4949
name: "tPositions",
@@ -61,10 +61,10 @@ import Layout from "../../layouts/Layout.astro";
6161
vertex: renderPassVertex,
6262
fragment: renderPassFragment,
6363
uniforms: {
64-
tPositions: () => positions.outputTexture,
64+
tPositions: () => positions.texture,
6565
},
6666
attributes: {
67-
aCoords: positions.coordsAttribute,
67+
aCoords: positions.coords,
6868
},
6969
transparent: true,
7070
});

lib/playground/src/pages/gpgpu/boids.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Layout from "../../layouts/Layout.astro";
2727
uCohesionWeight: 0.8,
2828
uBorderForce: 1,
2929
uBorderDistance: 0.8,
30-
tPositions: () => positions.outputTexture,
30+
tPositions: () => positions.texture,
3131
},
3232
dataTexture: {
3333
name: "tVelocities",
@@ -44,7 +44,7 @@ import Layout from "../../layouts/Layout.astro";
4444
fragment: boidsPositions,
4545
uniforms: {
4646
uDeltaTime: 0,
47-
tVelocities: () => velocities.outputTexture,
47+
tVelocities: () => velocities.texture,
4848
},
4949
dataTexture: {
5050
name: "tPositions",
@@ -62,10 +62,10 @@ import Layout from "../../layouts/Layout.astro";
6262
vertex: renderPassVertex,
6363
fragment: renderPassFragment,
6464
uniforms: {
65-
tPositions: () => positions.outputTexture,
65+
tPositions: () => positions.texture,
6666
},
6767
attributes: {
68-
aCoords: positions.coordsAttribute,
68+
aCoords: positions.coords,
6969
},
7070
transparent: true,
7171
});

lib/playground/src/pages/gpgpu/particles - FBO (static).astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ import Layout from "../../layouts/Layout.astro";
7676
}
7777
`,
7878
uniforms: {
79-
uPositions: () => positions.outputTexture,
79+
uPositions: () => positions.texture,
8080
},
8181
attributes: {
82-
aCoords: positions.coordsAttribute,
82+
aCoords: positions.coords,
8383
},
8484
transparent: true,
8585
});

lib/playground/src/pages/gpgpu/particles - FBO.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ import Layout from "../../layouts/Layout.astro";
8383
}
8484
`,
8585
uniforms: {
86-
uPositions: () => positions.outputTexture,
86+
uPositions: () => positions.texture,
8787
},
8888
attributes: {
89-
aCoords: positions.coordsAttribute,
89+
aCoords: positions.coords,
9090
},
9191
transparent: true,
9292
});

lib/src/hooks/usePingPongFBO.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export type PingPongFBOOptions<U extends Uniforms = Record<string, never>> = {
1313
};
1414

1515
interface PingPongFBOPass<U extends Uniforms = Record<string, never>> extends RenderPass<U> {
16-
outputTexture: DataTextureParams | WebGLTexture;
17-
coordsAttribute: Attribute;
16+
texture: DataTextureParams | WebGLTexture;
17+
coords: Attribute;
1818
}
1919

2020
export function usePingPongFBO<U extends Uniforms>(
@@ -32,8 +32,8 @@ export function usePingPongFBO<U extends Uniforms>(
3232

3333
const coords = new Float32Array(elementsCount * 2);
3434
for (let i = 0; i < elementsCount; i++) {
35-
const u = ((i % textureParams.width) + 0.5) / textureParams.width;
36-
const v = (Math.floor(i / textureParams.width) + 0.5) / textureParams.height;
35+
const u = (i % textureParams.width) / textureParams.width;
36+
const v = Math.floor(i / textureParams.width) / textureParams.height;
3737
coords.set([u, v], i * 2);
3838
}
3939

@@ -45,8 +45,8 @@ export function usePingPongFBO<U extends Uniforms>(
4545
});
4646

4747
const pingPongFBOPass: PingPongFBOPass<U> = Object.assign(fboPass, {
48-
outputTexture: initialDataTexture,
49-
coordsAttribute: {
48+
texture: initialDataTexture,
49+
coords: {
5050
data: coords,
5151
size: 2,
5252
},
@@ -65,7 +65,7 @@ export function usePingPongFBO<U extends Uniforms>(
6565

6666
pingPongFBOPass.render = () => {
6767
renderFn({ target: fboWrite });
68-
pingPongFBOPass.outputTexture = fboWrite.texture;
68+
pingPongFBOPass.texture = fboWrite.texture;
6969
Object.assign(pingPongFBOPass.uniforms, {
7070
[dataTextureName]: () => fboRead.texture,
7171
});

0 commit comments

Comments
 (0)