mirror of
https://github.com/ad044/lainTSX.git
synced 2024-10-22 15:09:05 +00:00
Using time reference value to fit in 32bit float.
This commit is contained in:
parent
664756eea7
commit
7acca4fa68
1 changed files with 4 additions and 2 deletions
|
@ -73,14 +73,16 @@ const LevelSprite = (props: LevelSpriteConstructorProps) => {
|
|||
void main() {
|
||||
vec4 t1 = texture2D(tex1,vUv);
|
||||
vec4 t2 = texture2D(tex2,vUv);
|
||||
float bias = abs(sin(timeMSeconds));
|
||||
float bias = abs(sin(timeMSeconds / (1600.0 / M_PI)));
|
||||
gl_FragColor = mix(t1, t2, bias);
|
||||
}
|
||||
`;
|
||||
|
||||
const timeRef = Date.now();
|
||||
|
||||
useFrame(() => {
|
||||
if (materialRef.current) {
|
||||
(materialRef.current! as any).uniforms.timeMSeconds.value = 1.5;
|
||||
(materialRef.current! as any).uniforms.timeMSeconds.value = Date.now() - timeRef;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue