• Bugs
  • spine-ts 4.1>spine-webgl>PolygonBatcher.ts>cull face bug

  • Изменено
Related Discussions
...

Took me a while to figure there was a bug with spine.ts when I was experimenting with WebGL face culling.

https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/spine-ts/spine-webgl/src/PolygonBatcher.ts#L76

Correction:

if (this.cullWasEnabled) gl.enable(gl.CULL_FACE);

Polygon culling is disabled by default therefore spine.ts never allows WebGL API to polygon cull.


https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/spine-ts/spine-webgl/src/PolygonBatcher.ts#L136

So face culling gets enabled at end() call but gets disabled at begin() call. My human eye perception is only seeing disabled face cull rendering. In practice, disabling face cull at begin() call is interfering with perceiving face cull rendering. :doh:


The PolygonBatcher instance is looping through many begin() and end() calls per second turning polygon cull on and off. Despite "this.cullWasEnabled" remaining "true", the time between the last end() call to the next begin() call is too brief for polygon cull to be enabled. To the human eyes, polygon cull appear to be disabled all the time.

Does your team need a sample project for this issue?

No, it's pretty clear, but thanks. I've added a comment to the issue. Sorry for the delay, a couple of our team members have been sick lately. Also, I heard that having kids was a Bad Idea. 😉

Thank you Nate and Mario for the update. The delay is understandable. I was shocked when attempting to cull the front, back, front&back faces didn't work.