#Job mesh generation

1 messages ยท Page 1 of 1 (latest)

distant torrent
#

I don't get what you mean

flat haven
#

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

distant torrent
#

What? You can do exactly that ๐Ÿ˜›

flat haven
#

i know you CAN but not in a general way

distant torrent
#

Oh no, you are right you need to add an offset to the index

flat haven
#

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

distant torrent
flat haven
#

f is for example

#

something that gives you the height of the location at x,y

#

g generates a mesh from heightmap data f

distant torrent
#

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

flat haven
#

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

distant torrent
#

Ah yeah, they are dependent on other each other so it is harder to parallelize them

flat haven
#

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

distant torrent
#

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.

flat haven
#

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

distant torrent
#

I think jobs can do it. But it is kind of a mute point since unity doesn't support task or mesh shaders ๐Ÿ˜›

flat haven
#

lol

distant torrent
#

It is "under consideration" :/