Hi, I am pretty new to Babylon.JS, love it so far, but got stumped with shaders recently.
- Run a WGSL compute shader to calculate the aggregate the inverse distances of each vertex from P. This is something I already implemented, very fast, I am happy with it as it solved my performance problem I had with plain JS.
- Feed back each vertex’s “heat” into a ShaderMaterial and use heat to color the right vertex.
I have trouble with step #3. I have no idea how to match each vertex in the shader to the right heat value. With WGSL I don’t understandt how to translate from the compute “world” that has a global_id.x, etc to the vertex shader world where VertexInputs are provided for you. Is there a way to compute Vertex related information in a ComputeShader, put it in a buffer, then use these values in the VertexShader?
Any pointers would help. Thanks!