-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Half-float attribute support #15480
Comments
I personally would love to see https://esdiscuss.org/topic/float16array Without such a data type, you have to manually perform the conversion to half-float which is cumbersome. I'm not sure we want code like the following in the library core: |
Could be a good idea to start with a example though. If I understand correctly, what we need in core is a way to hint the renderer that we attribute is half-float and then a helper (in examples) to convert the array. Correct? |
I think so. @simon-paris Do you want to give it a try? BTW: I have create a test fiddle for the forum some time ago that shows how to use a data texture with half float data ( https://jsfiddle.net/f2Lommf5/1856/ It would be great if the helper could also be used to convert the data for this use case. Right now, I manually set the half float value for |
How convenient^^ |
We may want to add that code in core then, so we can do it at upload time and it all works nicely? |
Okay. But one thing bothers me. |
So rather than adding |
I've meant we should not introduce a new property to |
Um, it seems that https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer |
Description of the problem
It's currently impossible to make a half float attributes work, since the GL buffer type is derived from the JS buffer type, and JS doesn't have a half float buffer type.
I'd like to add a special case to Uint16 and Int16 attributes that causes them to be interpreted as half floats.
Would this be acceptable?
Three.js version
Browser
OS
The text was updated successfully, but these errors were encountered: