hjoykim / THREE

c# port of Three.js
MIT License
118 stars 20 forks source link

RectAreaLights #2

Closed michaelsakharov closed 2 years ago

michaelsakharov commented 2 years ago

Do the Rect Area Lights work in your port yet? Also, this is a great project! It took me a while to find it but this is by far the best Threejs port to .net.

michaelsakharov commented 2 years ago

Looks like RectAreaLightHelper isn't Implemented

michaelsakharov commented 2 years ago

image Did a bit of work and managed to get them Semi working, so it looks like all the code was there just missing the RectAreaLightHelper which I just ported over, I'm not really sure if I ported it over correctly, as it appears to be the more complicated of the Light Helpers. and I don't really know Javascript all that well.

michaelsakharov commented 2 years ago

image Not sure what this weird Pattern is.

michaelsakharov commented 2 years ago

image Really not sure what could cause this

michaelsakharov commented 2 years ago

Commenting out like 61 in the Lights_Physical_Pars_Fragment.glsl shader fixes it, so its something with Specularity

michaelsakharov commented 2 years ago

Implemented the LTC Textures that were missing, I'm guessing thats the problem. Not sure if I did it wrong though, there's definitely something still broken. image

michaelsakharov commented 2 years ago

Im thinking its most likely the .png format im storing the LTC files in. Needs another format i think...

michaelsakharov commented 2 years ago

Hmm, I think I have hit a roadblock for me at least. Not sure how to get the LTC images in, While maintaining the correct pixel data, especially with Bitmaps, I don't know if they even can store floats.

michaelsakharov commented 2 years ago

image For now disabled the LTC stuff in the shader, this works well enough

michaelsakharov commented 2 years ago

RectAreaLights seem to cause a Memory Leak, its Generating Infinite Textures. Might be related to the LTC's

michaelsakharov commented 2 years ago

And fixed it.

hjoykim commented 2 years ago

OK!, good How did you that?

michaelsakharov commented 2 years ago

I didn't manage to fix the LTC, But the Memory leak was a mistake on my side it was constantly trying to load the LTC textures when it should have only done it once.

hjoykim commented 1 year ago

Hi, I updated some sources related to RectAreaLight. please refer to three THREEExample.Three.Lights.RectArealightExample.cs