Webgl mask rotaion bug,大概什么时候可以修复,谢谢!

openfl:6.3.0 ,lime: 5.8.0
编译条件为canvas时,采用shape作为mask是对的; 如下效果:
QQ20171107-100757

编译条件为webgl时,采用shape作为mask是错误的,不能对mask进行渲染。
QQ20171107-100857

测试代码如下:

package;
import openfl.display.Shape;
import openfl.display.Sprite;
class Main extends Sprite {
	public function new () {
		
		super ();

		var mask:Shape = new Shape();
		mask.graphics.beginFill(0x00ff00);
		mask.graphics.drawRect(0,0,50,50);
		mask.graphics.endFill();
		mask.rotation = 60;
		mask.x = 100;
		mask.y = 100;

		var test:Sprite = new Sprite();
		test.graphics.beginFill(0xff0000);
		test.graphics.drawRect(0,0,300,300);
		test.graphics.endFill();
		test.mask= mask;
		this.addChild(test);
		this.addChild(mask);
		this.addEventListener(openfl.events.Event.ENTER_FRAME,function(e){
			mask.rotation += 1;
			trace('hello world');
		});
	}
}

之前关于mask的问题:

Right now, we only support non-rotated square masking on GL, but I hope we can improve this soon

Great news!

This is now implemented in our OpenGL renderer – your sample works :wink:

However, it’s using a stencil buffer, which means it is there no smoothing enabled. The edges of the rotating square are a bit jaggy, but we are clipping now.

I plan on getting cacheAsBitmap + mask working enabling smoothing and finer support for transparency :slight_smile:

太棒了 :grinning: ,非常期待最新的版本 :slightly_smiling_face:

1 Like