P
P
Prizm2021-08-23 15:53:54
C++ / C#
Prizm, 2021-08-23 15:53:54

How to store magnitude maps in unity/c#?

For a unity project, you need to store the value as a "map". For example: texture maps, normals, lighting, height. In my case, this object should store a vector field. Approximate functionality:
1. a constructor indicating the image resolution and interpolation method.
2. set(uint x, uint y, float value) method for coloring a pixel.
3. methods get(uint x, uint y) and get(float x, float y), the second one with interpolation.
4. preferably a method for filling the map according to the algorithm similar to fill (Func method) and, if possible, the parameters of the filling area and the filling method (replacement / over).
5. preferably using methods for painting like brushes in photo editors
6. converting to bw image, but in my case this is only needed for debugging.
I understand that it is not difficult to write something like this yourself in c#, but it is unlikely to be fast enough. In addition, unity/c# probably already has a ready-made implementation for this object, but I don’t know what it should be called correctly. Therefore, I want to know - what implementations of such a card exist?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-08-23
@PrizmMARgh

Normal texture. In a unit, you can make a texture writable.
In sisharp - there is for example Bitmap - it is possible for them.
That's just with Fill there may be questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question