antvis / g-device-api

A Device API references WebGPU implementations

Home Page:https://observablehq.com/@antv/g-device-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

支持 polygonOffset

xiaoiver opened this issue · comments

目前 polygonOffset 为 boolean,开启后设置固定值:

gl.polygonOffset(1, 1);
截屏2024-05-21 上午10 50 31

需要支持 factor units 可配置:

void gl.polygonOffset(factor, units);

https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/polygonOffset
https://www.w3.org/TR/webgpu/#dom-gpudepthstencilstate-depthbias

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: Support polygonOffset

Currently polygonOffset is boolean. Set a fixed value after it is turned on:

gl.polygonOffset(1, 1);

Need to support factor units configurable:

void gl.polygonOffset(factor, units);

https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/polygonOffset

这样可以为 z-fighting 问题提供一种解决方案:
antvis/G#1688