LuxCoreRender / LuxCore

LuxCore source repository
Apache License 2.0
1.16k stars 145 forks source link

real adaptive subdivision #499

Open bestman8 opened 3 years ago

bestman8 commented 3 years ago

adaptive subdivision more like cycles has. i think it will help a lot with displacement.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/96585534-real-adaptive-subdivision?utm_campaign=plugin&utm_content=tracker%2F79505306&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F79505306&utm_medium=issues&utm_source=github).
juangea commented 3 years ago

LuxCore already has adaptive subdiv, what do you miss about it?

bestman8 commented 3 years ago

i mean more like cycles adaptive subdivision so it is not the hole mesh but the parts closest to the camera

Theverat commented 3 years ago

You will have to describe in more detail how this feature should work, and illustrate it with images. Or supply an example .blend file showcasing the Cycles subdivision.

bestman8 commented 3 years ago

this is just a plane with adaptive subdivisions on it afbeelding here is a image of how cycles does it luxcore subdivides the whole object but with cycles it depends on where the camera/viewer is and will subdivide the objects according to that

bestman8 commented 3 years ago

a few probably better images afbeelding afbeelding

bestman8 commented 3 years ago

here is that file so you can see it your self.zip go in camera view maybe move the plane so it updates and then move out camera view to see it from above like in the last images.

juangea commented 3 years ago

Very interesting, do you have the same example but with the LuxCore result?

bestman8 commented 3 years ago

i dont because i dont know how to visualize it with lux but there should the entire mesh be even

Dade916 commented 3 years ago

Actually, it is already supported:

viewscale

It is just adaptive simplification (i.e. you first uniformly subdivide and than adaptive simplify): https://forums.luxcorerender.org/viewtopic.php?f=5&t=1523

juangea commented 3 years ago

ah! it was the arlequin node what I was looking for to see the result :)

Dade is that the same that happens with adaptive subdivision?

I ask this becauseif subdivision is not adaptive you have to generate billions of polygons to simplify them afterwards, not sure it that's what is expected by adaptive subdivision or of a progressive subdivision would be more efficient avoiding the need to generate super big amount of geometry before.

Maybe everything happens under the hood and while we generate it in two steps the engine is just avoiding to generate the geometry that will be useless :)

Theverat commented 3 years ago

In my opinion, Subdiv + Simplify is a very poor substitute for real adaptive subdivision. The difference in memory requirement and compute time is immense. So I would also welcome "true adaptive subdivision" for single meshes in LuxCore.

Also, it might make sense to combine adaptive subdivision with displacement into one step, so the adaptiveness can better match the requirements of the displacement. For example, it could subdivide further in areas where the displacement texture has fine high-frequency detail, and subdivide not at all in areas where the displacement texture is uniform.

bestman8 commented 3 years ago

so should i rename it to real adaptive subdivision?

Dade916 commented 3 years ago

The subdivision is done by Pixer's OpenSubdiv.

juangea commented 3 years ago

Mmmh then may be easy to implement true adaptive subdivision since it’s part of the Pixar OpenSubDiv library :)

https://graphics.pixar.com/opensubdiv/docs/subdivision_surfaces.html

41D37E36-5799-4A05-8C05-C3ADA8A88051

Dade916 commented 3 years ago

@juangea, the links is for "Curvature-adaptive tessellation of B-spline surface" (see the label): it is for tessellation of parametric surfaces, it is quite different topic from the one asked by Bestman8.

juangea commented 3 years ago

Yeah, you are right, I just looked into it with more detail :)

mambobanda commented 3 years ago

View Dependent Adaptive Subdivision / Tessellation would be awesome. Especially if it takes the distance of the camera into account. Found one paper about it, there are several different ones out there. This is just for example.

http://hhoppe.com/proj/vdrpm/

And if you want to get even more fancy, there's subdivision that takes features into account.

"Feature-adaptive GPU rendering of Catmull-Clark subdivision surfaces" (Theres a paper out there).