Feeding simulation data into a shader
Asked Answered
C

1

0

Hi everyone,
I'm working on a visualization of a simple (and mostly inaccurate) climate simulation on a planet. So basically what I have is an icosphere with every vertex as a sample point in the simulation. What I'm trying to achieve is using a shader to visualize the data on the mesh. So for example having data showing the temperature on each sample point or which biome it belongs to.
What is the best way to feed that simulation data into the shader?
My first approach would be something like using a texture where each pixel corresponds to a sample point and the texture will encode the simulation data in the RGBA values. Then after each iteration of the simulation I'll create a new texture with the data and feed it to the shader. Is something like this feasible or is there a better way to do this?

Cryogen answered 30/5, 2023 at 19:26 Comment(0)
N
0

Cryogen Textures are fine for this. Alternatively you could use vertex colors but it limits your data amount to a single vec4 per vertex. With texture approach you can pack much more data into a single or multiple textures.

Nagari answered 30/5, 2023 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.