PDA

View Full Version : DPKit Edge node: usage?



jeric_synergy
11-03-2012, 03:32 PM
Can someone please post a screen grab of the proper connections of the DPKit Edge node? I can't seem to get it to do anything.

Thanks. :thumbsup:

Sensei
11-03-2012, 05:24 PM
I find it very buggy.
But normal usage is connect output Normal in Edge node to Normal in Surface.
Adjust Edge Width to your needs.

jeric_synergy
11-03-2012, 06:36 PM
I find it very buggy..
thanks sensei, got it to work. :thumbsup:

I see what you mean: I ran into this anomaly my very first time out (see attached Scene): frame #48 probably gives the best illustration of the problem.

Perhaps Edge Node is primarily intended for still image generation?

108951

Sensei
11-03-2012, 06:59 PM
Make 3D T letter - four boxes. Still frame. Use some higher Edge Width, so rounding is clearly visible. It doesn't look good.

dpont
11-04-2012, 01:21 AM
Great advice.. Normal must be connected to Normal,
euh.. also Color to Color?

Considering that Edge node is faking this round, smooth or bevel
effect without modifying the geometry, it is obviously limited and assumed.

Depends of geometry and lowering the edge size is recommended,
who would use so much large effect when the silhouette itself
is not modified, I have a list of other limitations or irregular
edges with extruded ngons, but nothing so different compared
to other tool using a similar process.

Peace,
Denis.

jeric_synergy
11-04-2012, 01:33 AM
Great advice.. Normal must be connected to Normal,
euh.. also Color to Color?
My first couple passes doing just that didn't do anything, so I figured maybe it was more complicated.

Don't know where it went south.

It's hard to know when one is just starting to use a new tool. Perhaps a working example included in the "Samples & Dox" file (I didn't see one) would help the next user.

dpont
11-04-2012, 01:21 AM
108960 108961

Your shape which is similar to the sample on the DP Kit page.
Note that none of these geometries are triangulated,
but the second mesh reduces the concave problem with ngons.

In your scene there's also an issue with raytraced shadows
which couldn't be solved in the node, again it is faking
rounder edges, raytracing is tied to real geometry.

Denis.

dpont
11-04-2012, 02:49 AM
Since a few edges are not shared by neighbored polygons,
there's two way to fix this,
checked the "Edged Holes" option in the node,
or merge points of your model.

Denis.

XswampyX
11-04-2012, 05:35 AM
It works for simple boxes. :)

http://i465.photobucket.com/albums/rr16/xXswampyXx/EdgeBoxes.jpg

Sensei
11-04-2012, 05:53 AM
Great advice.. Normal must be connected to Normal,
euh.. also Color to Color?


If you connect Color to Color and Normal to Normal, then whole effect calculated by normal is lost...

I guess so people the first time running this tool are expecting it will behave like Modo's Edge Shader..

dpont
11-04-2012, 06:30 AM
More difficult to avoid artefacts with a spherical mesh,
because the density of edge corners,
108963

Yes you get normal and color at the same time
(some specularity may help of course).

Edge node has nothing to do with Modo shader,
I didn't test it, but as far I know it can render
edge intersection between different objects,
so it needs to use a raytracing process instead
of the geometry analysis, one advantage
is there's no preprocess, but in LW this could be very slow.

Denis.

probiner
11-04-2012, 06:44 AM
dpont I use UV maps seams to save Edge Selection sets. For example, select the edges I want to save, "Make UV" with PLG then subdivide and do whatever and when I need those back just "Unweld by UV" seam with PLG, and Select the Outline Edges. Bam, got my selection back.

Question: couldn't you had a UV as input for the Edge Node? Threshold is ok, but being able to set a hard selections is nice.
As for the quality of the rounding, I'm no expert but from the times I used it, I had the feeling it could be better, or maybe my render setup was bad, I don't know. But could I reproduce this image without getting too much of black shading on edges that do not face me? Probably a bit of a stretch, I know I baked Normal maps and the result is almost identical. But use white backgrounds and what I talk about becomes noticible.
http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/images/GUID-D1E80C55-C0EC-4596-B771-28653A69143E-low.png

Cheers

dpont
11-04-2012, 07:59 AM
..Question: couldn't you had a UV as input for the Edge Node? Threshold is ok, but being able to set a hard selections is nice...

If you mean filtering the effect with a Map,
that should be possible with a node setup
mixing the spot normal and the edged normal.
On my page there are also a few sample of alteration
made with the function input.

If you mean specific references with UV coordinates
for seam detection, that's another job,
knowing that the Lightwave nodal system doesn't provide
UV coordinates directly, just barycentric coordinates
in the current polygon,
for a close view on one single object, rounding
in Modeler is probably a simpler task..

One of the major issues causing artefacts is edge corners
when some polygons are inside the threshold angle and
some other outside, especially if the Edge distance
is greater than the geometric edge length of the polygon.
Another aspect of the problem, is that Edge need to
do a compromise between geometric normal of flat polygons
and smoothed spot normal.


Denis.

probiner
11-04-2012, 08:11 AM
Of course angle threshold is not optimal, sure it works in most cases, but it is not fine control and it will fail many times.
An edge selection would be great, but since there's no such thing in LW for now, available in nodes also, I though that you could use the Seams of a UV as edge selection. Basically ignore all edges that are not in the UV seam. Coordinates don't matter in this line of though, just where the mesh is opened by the UV. I tried to filter once the effect with a Weight Map, you can imagine the results :) I'll shall try the spot normal and edge normal, though I didn't even knew we had access to edge normals or how would I setup that.

I'll write a post on a unified edge system for effects like these someday.

Thank you for the insight.

Cheers

Sensei
11-04-2012, 08:22 AM
An edge selection would be great, but since there's no such thing in LW for now, available in nodes also, I though that you could use the Seams of a UV as edge selection.

I showed how to do this in mine video tutorials..
https://www.youtube.com/watch?v=19BW3jxaV00
https://www.youtube.com/watch?v=bGwo1Fifh6Y

It also works with sub-patches, allowing to render edges between patches, instead of frozen triangles generated by patch..

jeric_synergy
11-04-2012, 08:37 AM
It works for simple boxes. :)
Swampster, when you embed images as above, they are sadly reduced in resolution to illegibility.

Since all your posts are informative, I'd really like to be able to read them. :thumbsup:

Could you please attach the images rather than embedding them? I know it's a more seamless forum experience, but reduced they're just enticing instead of educational. :(

As ever, thanks for all the help! :bowdown:

jeric_synergy
11-04-2012, 08:41 AM
If you connect Color to Color and Normal to Normal, then whole effect calculated by normal is lost...

I think the fact that Sensei, of all people, is confused by that post is witness to the idea that Edge node shader is not completely intuitive in use-- Sensei knows a million times more about LW than I'll ever know.

XswampyX
11-04-2012, 08:55 AM
Yeah, I know..... I only have a mobile signal for my internet and uploading files takes ages. :cursin: Also I don't want to stretch out the forum with a massive image. My screens quite wide.

Here you go.

108964

dpont
11-04-2012, 09:22 AM
...Coordinates don't matter in this line of though, just where the mesh is opened by the UV...

No way to know this directly in a node or spot info,
shortly a seam means discontinuous UV, but a spot has only
geometric references of the polygon it belongs to,
no vmap, needs extra process in mesh info,
but here still no "seam" info, we need to iterate all polygons
for detecting if it has multiple pair of coordinates in a map,
then we can conclude that it is discontinuous and in a seam..

More easy to paint the seam over an exported UV template
in an image or paint the mask whatever the UV map.

I do agree that mixing un-alterated spot normal and output Edge normal
is not so easy, since the LW Mixer doesn't allow direct root vector input,
may be more simple to input an image mask scaled by the correct value
in the Distance input of the Edge node.

Denis.

dpont
11-04-2012, 09:33 AM
...all people, is confused by that post is witness to the idea that Edge node shader is not completely intuitive in use-- .

Me personaly, I was more confused because you didn't merge your geometry.

Denis.

probiner
11-04-2012, 09:48 AM
Hmm no Sensei, your video doesn't show how to use and edge selection according to a UV map seams. There's just a Quad UV map going on with gradients in the borders of the UV Space. So in a way it's not much different than this: ftp://ftp.newtek.com/multimedia/movies/w3dw/PolyTrim.mov Though I admit that with your setup there's more control.

No, what I'm talking about is this using what we have now. Select some edges. Make UV and now the seams of the UV are your stored Edge Selection Set. Notice in the render only the top edge is rounded.
From my non programming perspective it would be just to have a pull down menu in the node, select a UV, done, only UV seams edges will be rendered round in the 3D object.
http://i153.photobucket.com/albums/s202/animatics/Lightwave/EdgeSet-UvMap.png

Later on someday I'll try to explain my idea better, but basically this solution is an echo of what I think there should be in place for Edges. One edge set could be input and boolean to perform: Hard Edges, Edge Weight, UV Seams, Render Round Edges. If you think about it makes sense since they overlap most times, even if partially.

Cheers

Sensei
11-04-2012, 10:18 AM
From node point of view UV is just two floating point numbers for U, and V.. They don't contain any special info about seams..

I am just telling you that you can simply make another UV map, and the closer U or V will be 0 or 1 border, they will be rendered as "edge".
For non-organic stuff, it's just a matter of selecting polygons and clicking Maps > Poly Maps > Quad Poly Map, and you have what you wanted - control where are edges.

When you know it that there is edge 1, or not 0, you can plug it to DP Kit Edge Width, or make your own rounding node setup.

The closer spot is to edge, the more of normal is taken from Smoothed Normal (TrueArt's Node Library > Extended Spot Info > Smoothed Normal), otherwise the more is taken from Normal/Geometric Normal.

probiner
11-04-2012, 10:47 AM
Thanks for the insight, didn't know it wasn't aware of edges. Though the rational is quite easy imho. In complete UV maps (containing all parts of a connected mesh) the UV seams are edges with 2 representations in the UV space. All the others have one representation only.

I know about masking sensei, I tried it before. But that will only mask the normal shading the Edge Node generates for ALL edges, not actually select which edges it calculates the rounding in the first place. That would give a bad result: Say you pick my cube up there and you do that to the top edges like I do; you would see not only the top edges rounded, but also a very small bit of those vertical edge coming down rounded as well, stopping where the mask of the top edges stop. Looking really bad.

Though the result I present in that image is not pretty too because the vertical edge is not rounded at all, so the corner doesn't look rounded. But at least it's more into the rational than having a the Edge node make a 'T' shape in there.
Anyway I faked it by unwelding the base points. Both solutions suck. An edge set is required.

Need to try Denis suggestion, but no time now.


Cheers


PS: For better clarification.

Top: I faked the previous post render unwelding the bottom points, so it looks bad on the corner.
Bottom: With the mask applied to Width. Notice it bleeds to the unwanted edge.

http://i153.photobucket.com/albums/s202/animatics/Lightwave/EdgeSet-UvMap-Compared.png

So, edge set input is need imho to define which edges rounding is calculated in the first place.

Cheers

jeric_synergy
11-04-2012, 01:18 PM
Yeah, I know..... I only have a mobile signal for my internet and uploading files takes ages. :cursin: Also I don't want to stretch out the forum with a massive image. My screens quite wide.
Here you go.
108964
Thank you so much: seriously, your posts are an education in themselves. I know I'm not alone in learning a ton from them.

dpont
11-05-2012, 06:38 AM
I tested a bit different ways for masking edges
including internal point or vertex selections
or external masking setups,
with relative success but never found an universal solution,
depending of the model type.

First internal selections,
the discontinuous UV is limited because
the edge node effect is rendered in two parts
one per adjacent polygon, so this selection could
only render 50% of the roundish effect,
weight map (as internal selection) is limited
for corners, as I can see it is less convincing
if one edge is missing in the solution.

Then masking,
pre-masking by using the Width input of Edge
has a bad side effect, a leak in corner edges,
so post-masking by mixing Edge normal and Spot normal
is cleaner,
here an example with a weight map,
108973
the node setup,
108974
(The Math Vector Scale is set to 100%, just for
converting color to vector)
The threshold set to 0.95 (relative to the Edge width
and edge length of the model)
108976
threshold set to 0.99 (similar with what you could get
with an internal discontinuous UV selection)
108975

I guess that other kind of mask should be used
for other model or selection,
in the case of a box, for selecting the top
and bottom and leaving intact the side edges,
the box should be sliced horizontally for inserting
zero values in the weight map, a gradient with
local Y coordinate could be more interesting,
or a painted texture map for complex models.

Denis.