PDA

View Full Version : Displacement in LW only if polys available ?



madno
08-15-2012, 05:11 AM
Hi, trying a lot of tips and tricks I found in the forum to let LW displace a brick wall.

Coming from Poser and thought it works the same in LW:

For Poser:
- I make a displacement map
- I add it to the displacement node input of the surface
- I render it

For LW I tried the same, but do not get a result.
In the forum there is sometimes mentioned something like "subdevide to get enough geometry ..."

Maybe this is my misunderstanding.
In Poser I put the map on one big polygon. Poser then uses the map to add geometry by itself and uses that one for the displacement effect.

Is there a way to do it the same way in LW?

SplineGod
08-15-2012, 05:37 AM
Try going to object properties====deform tab====enable bump

zardoz
08-15-2012, 05:42 AM
yes, usually that's the case. You have to go to object properties and increase the render subpatch level to a higher number. And your object must be a subpatched object or else it won't subdivide.
or you can try dpont MicroDisp: http://dpont.pagesperso-orange.fr/plugins/DP_MicroDisp.html

madno
08-15-2012, 06:09 AM
Thanks for the help,

SplineGod, I tried the deform tab with alot of different settings ("Add Displacement", "Enable Bump", "Edit Nodes" in Deform tap). Last try was now with displacement node in surface editor). Do you mean that I first need to give LW a subD object and then can use the displacement (like zardoz says in the second reply)?
Zardoz, I will try out MicroDisp.

lardbros
08-15-2012, 06:33 AM
Try going to object properties====deform tab====enable bump

But that isn't MicroPoly displacement is it Larry?

I'm pretty certain (almost 100%) that LW doesn't do this... MPD (micro-poly displacement) hasn't been implemented yet. It's kind of something we've all been hoping for for some time.

DPont's plugin will help...

but the only way you can displace a surface is if you add the geometry, or use sub-division surfaces and make the render-time subdivisions higher than the display ones.

Hope that makes sense?

VermilionCat
08-15-2012, 06:35 AM
Hi,
The object only has 150 polys so subdivide more and set subd order to first.

madno
08-15-2012, 07:01 AM
Ok, make a quick test with DPs MicroDisp. As I understand it so far, it replaces the whole "wall object" (all four walls are one object) with a kind of volume copy and then uses the gray scale map all over it for the displacement. Need to try more.
But first will try the subD approach.

zardoz
08-15-2012, 07:11 AM
actually what happens is this: lw will move points accordingly with the grey values of your displacement map. So in the your case if you have a polygon with 4 points and you apply this brick map the 4 points (in the corners) will move from their position an offset that is applied by the grey value in your map. the rest of the polygon doesn't have points to be displaced. So you need to subdivide it. You can do it in modeler by dividing the mesh, or by turning it into a subpatched mesh, with it's implications. If you simply subdivide the mesh, using tools like bandsaw, knife, etc you must do it so that you have more points where the displacement map has more changes in the grey values. If you turn the mesh into a subpatch you can then control the amount of subdivision at render time.
In the end, you simply need points to be displaced.

You're adding the displacement in the surface nodes and I guess I never did that...I only add displacements in the object properties in the Displacement options/edit nodes.

I played with microdisp by dpont and it works fine, only a bit slow. but I didn't spend enough time with it to optimise it.

PS: I was typing this while you posted the previous post...yes, try it with microdisp and post you experiments here.

XswampyX
08-15-2012, 11:27 AM
You could try the excellent modeler plug-in Texture scape to create your wall mesh.

You will need a new image map that maps the difference between the different levels on your displacement map. This is made by making 2 identical layers of your displacement map and then blur each layer, but use different blurring algorithms on each layer. Then make the top layers overlay mode use the difference blending mode to get a rather dark, but useful image.

Like so.

http://forums.newtek.com/attachment.php?attachmentid=106259&stc=1&d=1345051190

Use this as the texture for the Texture scape plug-in.

And you get this.

http://forums.newtek.com/attachment.php?attachmentid=106260&stc=1&d=1345051322

This mesh will deform very well in layout and it's only 2000 polys.

http://forums.newtek.com/attachment.php?attachmentid=106261&stc=1&d=1345051443

Hope that helps. :D

lardbros
08-15-2012, 11:58 AM
Whoah.... Whoah there Swampy! How come I've never heard of this texture scape plug in? Is it free? And if so, where can I get it?

Is there any chance you could elaborate on the blurring algorithms bit... It would be amazing to know the best way to use that plug in!

Jeeeesus! The LW community never ceases to amaze me! :)

XswampyX
08-15-2012, 12:01 PM
I'll knock up a video if you like?

Cageman
08-15-2012, 12:07 PM
I'll knock up a video if you like?

That would be cool! :thumbsup:

jeric_synergy
08-15-2012, 12:12 PM
Not to steal Swampy's thunder, but:

http://amber.rc.arizona.edu/lw/texturescape.html

Sheesh, around since LW6! Oy. --There's really too many great tools to keep track of.

lardbros
08-15-2012, 12:28 PM
I'll knock up a video if you like?

I'd definitely like! :) You're a star!


Thanks Jeric for the plugin... I think I actually have some of these terrain plugins, but never thought of applying it in this way... god knows why, but it's great! Well done guys! LightWave is so great because of this huuuge hive-mind... we can do anything!!! Mwahh-ha-haaaa!

XswampyX
08-15-2012, 12:31 PM
Here you go.....

http://youtu.be/PuLYtM1BUWk

Made from some random z-depth map.

Came out pretty good. :hey:

lardbros
08-15-2012, 01:00 PM
Woooo! That was VERY quick! Thanks Swampy!!! :)

Oedo 808
08-15-2012, 02:04 PM
Looks cool, I think I downloaded that plug-in not so long ago, but I don't think I even added it yet. Thanks for the scene XswampyX, this one may just escape my to-do folder and actually get looked at ;D

lardbros
08-15-2012, 02:05 PM
Was just wondering... I've tried in the past, but never got it to work properly.

BUT... is it possible to do a texture-based subdivision using the APS? I've just tried setting it up using a gradient as an input for a texture, but it doesn't seem to do what I'd expect.


Anyone got this to work at all?

zardoz
08-15-2012, 02:52 PM
lardbros, I guess what you would expect from aps is what I am talking about in this thread
http://forums.newtek.com/showthread.php?t=70061

something like dponts curvature node would be perfect for this

because if we use a gradient applied to the displacement map it won't work...what we need is something that detects curvatures (in math it is the derivative, it detects the rate of change) so flat areas are less subdivided.
As an example we can imagine a hill...the ground is flat so is less divided, then where the hill starts we get more division, the side of the hill is flat too, so it gets less divided. where the side meets the top should have more division, and then the top because its flat should have less division too.

jeric_synergy
08-15-2012, 03:03 PM
Was just wondering... I've tried in the past, but never got it to work properly.

BUT... is it possible to do a texture-based subdivision using the APS? I've just tried setting it up using a gradient as an input for a texture, but it doesn't seem to do what I'd expect.

Anyone got this to work at all?
I coulda sworn I saw what you expected either from Larry or on one of his DVDs, and just recently at that. "Enable Bump" and the subpatch setting (per polygon) were the keys, but I couldn't get it to work 2day. :cursin: :grumpy:

lardbros
08-15-2012, 03:16 PM
Yep, that's what I'd expect. But how would I get that working?

What I want is a greyscale texture to be driven by a gradient, which will then subdivide the geometry where the highest value of the texture is.

Did you ever get it working properly?

Also, dponts curvature node... what would I do with that?

lardbros
08-15-2012, 03:18 PM
Would be cool if Larry could chime in... he's a clever guy, I'm sure he could elaborate on his post above.

XswampyX
08-15-2012, 03:41 PM
lardbros, I guess what you would expect from aps is what I am talking about in this thread
http://forums.newtek.com/showthread.php?t=70061

something like dponts curvature node would be perfect for this

because if we use a gradient applied to the displacement map it won't work...what we need is something that detects curvatures (in math it is the derivative, it detects the rate of change) so flat areas are less subdivided.
As an example we can imagine a hill...the ground is flat so is less divided, then where the hill starts we get more division, the side of the hill is flat too, so it gets less divided. where the side meets the top should have more division, and then the top because its flat should have less division too.

What you are describing is edge detection.


"Difference of Gaussians" - This filter does edge detection using the so-called “Difference of Gaussians” algorithm, which works by performing two different Gaussian blurs on the image, with a different blurring radius for each, and subtracting them to yield the result. This algorithm is very widely used in artificial vision (maybe in biological vision as well!), and is pretty fast because there are very efficient methods for doing Gaussian blurs. The most important parameters are the blurring radii for the two Gaussian blurs. It is probably easiest to set them using the preview, but it may help to know that increasing the smaller radius tends to give thicker-appearing edges, and decreasing the larger radius tends to increase the “threshold” for recognizing something as an edge. In most cases you will get nicer results if Radius 2 is smaller than Radius 1, but nothing prevents you from reversing them, and in situations where you have a light figure on the dark background, reversing them may actually improve the result.

http://docs.gimp.org/en/plug-in-dog.html

zardoz
08-15-2012, 04:26 PM
yes, I noticed that if you get a displacement map out of zbrush for example and use a edge detection filter to create a new image and use this image with a gradient, this would be perfect for aps...but I think that aps isn't very good at generating the subdivisions...

zardoz
08-15-2012, 04:55 PM
in lightwave the curvatures node would give something like the pic curvatures_surface (surface from pic curvatures_surface_node_editor), where in white are areas with no change, and the blue and red areas are places where there's a curvature (in opposite angles). So what we need is a system that would detect these areas and apply a higher subdivision here and a lower one in the white areas, where we don't need it.
So if we use the distance to camera to change the level of subdivision (pic curvatures_surface_edges_0_10), in this case from 0 to 10, we should be able to use the curvatures node to do the same applying subdivisions where we most need them. How? In the objects properties, we choose Per Polygon Level and then create a new procedural layer, type: Node Editor (pic curvatures_geometry). Inside this node editor I tried to use the curvatures node, but I couldn't. I tried to feed directly scalar values and I noticed that values from 0.1 to 1 would have effect, but when using the node tree in pic nodes_curvatures_aps it simply stops lightwave. Task manager shows 25% cpu...I have a quadcore so it's using only one cpu and it takes so long that something must be wrong.

This would be of great value for make better use of our ram, by using less polygons. I don't know if this would compensate the cpu used to calculate the adaptive subdivisions versus just subdividing the whole mesh with the same value.

XswampyX
08-15-2012, 05:36 PM
I can't get aps to use any textures at all! Distance to camera yes, Weight maps yes, anything else images, procedurals ...... no. :grumpy:

Have I missed something?

madno
08-19-2012, 06:07 AM
Hi,
got the microdisplacement to work (need very high subD values though).
But I am failing to restrict the displacement into the poligons normal (please see screenshot, as it is difficult to describe).
I should do something with the spot info node and vectors, right?
Tried SpotInfo -> normal, put that into scalar vector and that one into the displacement node, but with no success.

lardbros
08-19-2012, 06:27 AM
I can't get aps to use any textures at all! Distance to camera yes, Weight maps yes, anything else images, procedurals ...... no. :grumpy:

Have I missed something?

Don't think you have... I've had SOOO many attempts at this and nothing works. It would be brilliant if this could be sorted out. Currently APS is pretty useless if you can't control it with textures.

Sanchon
08-19-2012, 08:10 AM
This trick work better if you change mipmap mode of displacement texture to "softness" and use high mipmap strength like 20-50. It will soft every jaggies and you can load every image without doing post gaussian blur/difference effects.

XswampyX
08-19-2012, 08:31 AM
Hi,
got the microdisplacement to work (need very high subD values though).
But I am failing to restrict the displacement into the poligons normal (please see screenshot, as it is difficult to describe).
I should do something with the spot info node and vectors, right?
Tried SpotInfo -> normal, put that into scalar vector and that one into the displacement node, but with no success.

I would put a weight map onto your wall, and set it's value to 100 where you want the displacment (the front). Then it's just a simple multiply node.

Amurrell
08-25-2012, 06:49 AM
I just wonder how Modo goes about this? I remember placing a brick texture on a wall without going through a lot of subdivision and the thing displaced beautifuly and gave me exactly what I wanted. I didn't think about it until I tried to do the same in LW and it didn't work. Well it worked, just not the same way. There must be some subtlety that I'm missing between apps.

Cageman
08-25-2012, 07:29 AM
Modo has subpixle displacement, LW does not, and there is the difference, I think.

LW really needs this ASAP! DPonts tool is nice, but it is volumetric, and as such, takes ages to render.

probiner
08-25-2012, 08:14 AM
Wow this is how Adaptive subdivision should be.
Thanks for the video XswampyX