markaren / threepp

C++20 port of three.js (r129)
MIT License
625 stars 59 forks source link

CubeMap texture support #131

Closed DanielLinPioneer closed 8 months ago

DanielLinPioneer commented 1 year ago

I want to add a cubemap texture function and implement the envMap feature in GLBackground.cpp. I tried adding CubeTexture and CubeTextureLoader and wrote a shader code to verify. I used RenderDoc to see that the cubemap texture was loaded correctly, but I still can't see the result. I've been trying for a week, and I think I'm very close. I can provide the code I wrote, can you help me identify the problem?

markaren commented 1 year ago

Consider opening a PR with what you got so far, and I''ll try to take a look when I have time. Some of the rendering code is spagetthi, especially w.r.t stuff that has not been implemented, so it could be subtle things related to this feature both here and there that are missing.

DanielLinPioneer commented 1 year ago

It is indeed quite complex to implement the envMap feature, so I would like to start by implementing the CubeTexture feature and verifying the process using ShaderMaterial. I traced the code to GLRenderer and GLUniforms, and all the states seem to be fine, but the image is not being rendered. Therefore, I need your assistance.