nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.25k stars 233 forks source link

VD Experimental - current known issues #2615

Open zeffii opened 5 years ago

zeffii commented 5 years ago

you need to use recent version of Blender 2.8+

Durman commented 5 years ago

Looks like non convex polygons does not supported yet

2019-10-19_23-00-16

portnov commented 5 years ago

Were they supported in 2.79?...

Durman commented 5 years ago

There was option on N panel for viewer node.

zeffii commented 5 years ago

ah.... if the concave is a Quad, it should be tessellated, instead of my assumption [[a, b, c], [a, c, d]]

zeffii commented 5 years ago

see..

https://github.com/nortikin/sverchok/blob/5cdd2a8fd35127c8066f038181dd56ff71c07121/nodes/viz/vd_draw_experimental.py#L67-L86

zeffii commented 5 years ago

i'll add a property, so


   elif num_verts == 4 and not self.convex_quads:
         ...

let me consider this over night :)

Durman commented 5 years ago

For convex polygons it is possible to use such triangulation: https://en.wikipedia.org/wiki/Fan_triangulation

if is_convex([coords[idx] for idx in idxset]):
    new_faces = []
    for i in range(2, len(idxset)):
        new_faces.append((idxset[0], idxset[i - 1], idxset[i]))

Also there is another interesting type of polygons: https://en.wikipedia.org/wiki/Star-shaped_polygon

zeffii commented 5 years ago

@Durman in b28 openGL using "Core Profile", we must turn everything into Triangles. The reason i "hand" tessellate the Quad is to keep the processing time of the Quad down to a minimum. Most quads we encounter are convex, and can be done this way a b c d -> a b c, a c d . It therefore doesn't make sense to always call a dedicated tessellate function on each Quad, this would penalize most polygons most of the time.

The concave quad is a special case, and testing for it first would also slow us down, so the solution will be like in VDMK2 to have a flag to say " OK, we must call the tessellate_polygon function on all non Tri faces, because we are expecting mixed input:

  1. Concave Quads, and
  2. Irregular Ngons

that's why a test like

 elif num_verts == 4 and not self.convex_quads:
         ...

will result in the least speed damage to the "ensure triangles" function.

Durman commented 5 years ago

As i know is_convex takes O(n) time. So it should not slow down process too much. And there is benefit of using such test as triangulation of convex polygons for O(n) time. I actually don't know how implemented the mathutils function. Perhaps it makes such test inside itself. I think only speed tests can lit light on this issue.

zeffii commented 5 years ago

i've committed the fix needed, for sake of speed vd_experimental will assume quads can be "serialized the dumb way", unless users switches on handle_concave_quads in the properties panel.

Durman commented 5 years ago

This raises cascade of errors. Weirdly.))

2019-10-30_12-50-16

zeffii commented 5 years ago

we can add a test like


def is_input_vertex_kind(socket_data):
    return len(socket_data) and len(socket_data[0][0]) == 3
Durman commented 5 years ago

It would be nice if the node will become red.

zeffii commented 5 years ago

OK. that's probably reasonable.

Durman commented 5 years ago

Well it have taken some time for figuring out what is going wrong.

portnov commented 5 years ago

See also data_structure.get_data_nesting_level, data_structure.ensure_nesting_level.

portnov commented 5 years ago

See also implicit_conversions parameter of sv_get() method.

zeffii commented 5 years ago

there's a potential to add debugprint using bgl/blf directly beside the node that fails. Like sverchok redux did (i can't find a screenshot of it):

zeffii commented 5 years ago

screenshot of sverchok redux node error handling

i am very tempted to implement this now.

portnov commented 5 years ago

I don't think it's good idea to write the whole stack trace in the viewport; maybe only the error message?

Durman commented 5 years ago

The same thought. Probably it would be better to make a reference to console or log file in Blender for more details.

zeffii commented 5 years ago

yeah, a more simplified traceback. it's worth trying

DolphinDream commented 4 years ago

@zeffii Here’s an idea for fixing the linewidth > 1px issue on mac. A fix for the annotations (on mac) is presumably coming up in 2.82 (hopefully). I don’t know if this annotation issue is related to viewer draw line/edge width issue in SV, but it’s worth checking it out.

https://developer.blender.org/T57570 https://developer.blender.org/rB014eb69cf858036816d12a4b92ffe6681978b683

zeffii commented 4 years ago

yes, the solution would need to be a vertex_shader / fragment_shader combo. (that's what the pull-request is ), i can experiment with it, it looks a little like the code I was experimenting with a while back.

we can make it the default behaviour for sverchok on osx, and optional for the other OS's (it might even look better because of the AA ).

No ETA on that.

zeffii commented 4 years ago

i don't think i'll add https://developer.blender.org/F8403764

zeffii commented 4 years ago

but here's a start branch , for exactly that.. https://github.com/nortikin/sverchok/pull/2965

zeffii commented 4 years ago

@DolphinDream .. it seems they removed: https://developer.blender.org/F8403764 (above link)m which is what I was basing it off.

zeffii commented 4 years ago

this beast: https://developer.blender.org/rB014eb69cf858036816d12a4b92ffe6681978b683

DolphinDream commented 4 years ago

I wonder if geometry shaders would be the way to go.. if Blender 2.8x supports them.

https://blog.tammearu.eu/posts/gllines/

zeffii commented 4 years ago

i think it does, but turning edges into cylinders is a little expensive :)

zeffii commented 4 years ago

experiment. stuff is sometimes easier than it seems, but sometimes far more complicated than it should be conceptually :)

DolphinDream commented 4 years ago

More interesting stuff.. with some webgl demos:

https://mattdesl.svbtle.com/drawing-lines-is-hard https://github.com/mattdesl/webgl-lines

https://github.com/spite/THREE.MeshLine

zeffii commented 4 years ago

add them here : https://github.com/nortikin/sverchok/issues/2608

zeffii commented 2 years ago

https://github.com/nidorx/matcaps maybe : ) https://www.geeks3d.com/dl/show/50100 with matcap pixel and vertex shader.