mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
fix splash screen webgl at alipay (#6103)
* fix splash screen webgl viewport for alipay * fix splash screen webgl at alipay
This commit is contained in:
@@ -334,8 +334,14 @@ export class SplashScreenWebgl {
|
||||
const elapsedTime = time - this.startTime;
|
||||
const precent = clamp01(elapsedTime / this.setting.totalTime);
|
||||
const alpha = easing.cubicOut(precent);
|
||||
|
||||
|
||||
gl.enable(gl.BLEND);
|
||||
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
||||
|
||||
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
|
||||
|
||||
gl.clearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
|
||||
gl.depthMask(true);
|
||||
gl.clearDepth(1);
|
||||
@@ -344,6 +350,9 @@ export class SplashScreenWebgl {
|
||||
|
||||
gl.useProgram(this.program);
|
||||
|
||||
var resolutionLocation = gl.getUniformLocation(this.program, "u_resolution");
|
||||
gl.uniform2f(resolutionLocation, gl.canvas.width, gl.canvas.height);
|
||||
|
||||
let location = gl.getUniformLocation(program, "u_alpha");
|
||||
gl.uniform1f(location, alpha);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user