D
D
dom1n1k2016-07-11 01:15:13
WebGL
dom1n1k, 2016-07-11 01:15:13

Where can I read about WebGL float textures?

Interested in floating-point textures in WebGL. More specifically, in the context of non-graphical computing. Questions like this (probably naive):
- is it possible to represent a texture as a 2d array of float numbers and process arbitrary data there?
- Is it possible to store numbers less than 0 and more than 1 in such a texture?
- Is it possible to search for something in such an array, get and insert pieces?
- is it possible to pass data between a texture and a typed js array?
- Are there any libraries for this business (not for drawing and not for games)?
Googled, but didn't find anything clear. Everywhere typical superficial reviews.
Probably bad Google. Surely there must be some places with good materials.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toly19, 2016-07-14
@toly19

I won’t tell you anything about the literature, but I’ll answer the questions:
1- webgl has a function gl.readPixels , which allows you to read a certain area of ​​the frame buffer (reading from the texture) into a certain buffer. If you know the width and height of the reading area, you can easily turn a one-dimensional array into a 2-dimensional one.
2- range of values ​​in float point texture [- infinity, + infinity] with 32-bit precision for all 4 channels (8 bits per channel - 256 colors)
3- array (color buffer) under the full control of the programmer
4- see 1- for reading. gl.texImage2D can take as the last parameter a buffer of colors (a typed array) that needs to be written to a
5-x3 texture

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question