tywang2006 Posted August 29 Share Posted August 29 createFogEffect() { const fragmentShader = ` precision mediump float; uniform float time; void main(void) { float fogIntensity = clamp(0.5 + time, 0.0, 1.0); gl_FragColor = vec4(fogIntensity, fogIntensity, fogIntensity, 1.0); } `; this.fogFilter = new PIXI.Filter(null, fragmentShader, { time: { type: '1f', value: 0.0 } }, { legacy: true }); this.fogFilter.uniforms.time.value = 0.1; this.effect.sprite.filters = [this.fogFilter]; } first time to do shader in v7, but it seems incorrect, uniforms just been ignored, if i do gl_FragColor = vec4(0.5,0.5,0.5,1.0) or just use some fixed value instad of time, the shader is working Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted August 29 Author Share Posted August 29 i also remove { legacy: true }, same issue Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.