Open mvaligursky opened 3 weeks ago
Also note that the WebGPU implementation only handles rendering to Mipmap. The ultimate goal is to be able to write a custom mipmapper (specifically to generate mip versions of a depth texture). For this we need two parts:
For WebGPU, we need to create a custom view with some levels. For WebGL we need to use this texParameteri calls from the description. Note that we could avoid writing a public API for this, as that could be tricky, and implement this under the hood only. WebgpuMipmapRenderer effectively does it already.
see the API / WebGPU implementation here: https://github.com/playcanvas/engine/pull/7051
it might need these to be utilized:
related issue: https://github.com/KhronosGroup/WebGL/issues/3614
I tried to implement it but without success, the PIX capture shows that we render to level 1 as set up, but when sampling the texture to display it on the screen, only level 0 was somehow exposed. The above parameters didn't seem to make any difference. Note: we create top level using
texImage2D
, and then create full chain usinggenerateMipmap
- it's possible we need to create the whole chain usingtexImage2D
ortexStorage2D
.