fix(frontend/test): MkAnimBgで毎回Chromaticの差分が生成されないように
This commit is contained in:
parent
0d8e1c5421
commit
153eed7d71
1 changed files with 10 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, shallowRef } from 'vue';
|
||||
import { defaultStore } from '@/store';
|
||||
import isChromatic from 'chromatic/isChromatic';
|
||||
|
||||
const canvasEl = shallowRef<HTMLCanvasElement>();
|
||||
|
||||
|
@ -204,6 +204,10 @@ onMounted(() => {
|
|||
const vertices = [1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0];
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.DYNAMIC_DRAW);
|
||||
|
||||
if (isChromatic()) {
|
||||
gl!.uniform1f(u_time, 0);
|
||||
gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4);
|
||||
} else {
|
||||
function render(timeStamp) {
|
||||
gl!.uniform1f(u_time, timeStamp);
|
||||
gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4);
|
||||
|
@ -212,6 +216,7 @@ onMounted(() => {
|
|||
}
|
||||
|
||||
handle = window.requestAnimationFrame(render);
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
|
Loading…
Reference in a new issue