Jump to content

IE zOffset / polygonOffset issue


Kesshi
 Share

Recommended Posts

It seems that IE doesn't reset the polygon offset correctly. I created a playground to demonstrate the issue:
http://www.babylonjs-playground.com/#25N9HL
The red plane in the PG has a zOffset. For some reason the offset is also applied to the knot under IE (see attached images).

I was able to workaround this issue by modifying this code:
https://github.com/BabylonJS/Babylon.js/blob/master/src/States/babylon.depthCullingState.ts#L173
I added "gl.polygonOffset(0, 0);" before "gl.disable(gl.POLYGON_OFFSET_FILL);" like this:
 

// zOffset
if (this._isZOffsetDirty) {
	if (this.zOffset) {
		gl.enable(gl.POLYGON_OFFSET_FILL);
		gl.polygonOffset(this.zOffset, 0);
	}
	else {
		gl.polygonOffset(0, 0);
		gl.disable(gl.POLYGON_OFFSET_FILL);
	}
	this._isZOffsetDirty = false;
}

How should we fix that issue? Is there a better place to add this workaround?
I'm not sure if its a general IE bug. I tested it only on two systems.

IE.JPG

Chrome.JPG

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...