#Job mesh generation
1 messages ยท Page 1 of 1 (latest)
okay
well you can't take two small chunks of meshes and simply append them to one another
and then get the bigger whole
you have to create geometry to connect two chunks of a mesh generally to make it useful
you can't just merge two pieces of contiguous memory and get a bigger, valid, connected, correct mesh
so if g creates meshes from data f
What? You can do exactly that ๐
i know you CAN but not in a general way
Oh no, you are right you need to add an offset to the index
like each way you want to do it, it has to be really bespoke
and what i'm saying is the general way, and i might be wrong, the attempt to do that in graphics APIs is mesh shaders
so i assume there is a way to do this for e.g. turning heightmaps into terrain geometry
so there's some terrain mesh generating function g for heightmap generator f such that g(f(0 to 10)) = g(f(0 to 5)) cheaply appended to g(f(6 to 10))
does that make sense?
and you can author a specific g for everything youw ant to do
but if you wanted a general one, that's what mesh shaders are for
they contrain you to how much geometry per unit data you can emit, and i think you have to follow some other rules about what the "border" of your little piece of mesh looks like
I don't get what your pseudo go is saying, what is f meant to be, and what is the range that it is being given?
f is for example
something that gives you the height of the location at x,y
g generates a mesh from heightmap data f
As long as you always give the proper vertex/index offset you can operate on a single mesh an even treat it as if it was multiple meshs from any number of any jobs
okay let me give you an example where this is not the case
let's say i made a metaball system
if i computed the meshes for two metaballs in isolation
and those metaballs had overlapping radii
i can't easily just append the mesh data to create the geometry of two metaballs from the geometry of one and the geometry of another. that's the whole point of metaballs, there are rules that are interesting about merging the smaller parts
however, someone has made compute shaders for metaballs, you certainly CAN do this, there just isn't a generic way
Ah yeah, they are dependent on other each other so it is harder to parallelize them
yeah
you can't just append the memory regions together or whatever
g(f(0..10)) does not equal g(f(0..5)) "plus" g(f(6..10))
there's no way you can operate on the vertices
you can't just operate on the vertices of the metaballs if you wanted to "merge" them
am i starting to make sense
Oh I think I get what you are talking about. My plan was to just schedule the jobs after the child jobs have been completed.
well i'm saying it's super sensitive to what you actually want to do
and if you're looking for a general way to turn data into meshes, it looks like it might be compute shader -> task shader -> mesh shader
I think jobs can do it. But it is kind of a mute point since unity doesn't support task or mesh shaders ๐
lol
It is "under consideration" :/