double displacement and dicing

   4703   2   2
User Avatar
Member
22 posts
Joined: June 2006
Offline
Hi everyone,
I'd like to understand how dicing and displacement really work so I made a few tests.

For instance, starting from a simple grid I'd like to displace a square (displacement 1) using a simple square white texture on black bg, then apply a second displacement and extrude other cubes from the vertical sides of the cube (displacement 2).

1 - we have our initial grid (the grid is seen by side in this picture, and the blue dots are poly primitives).

Now, please correct me where I am wrong:

As far as I understood reading in the documentation, Mantra performs the following steps when dealing with a displacement shader:

2 - dicing
3 - displacement

At this point, if I apply a second ‘displace along normal’ vop in the shader , using another texture (say a bunch of white squares on a black bg), I should get a mess on the stretched micro-polygons generated by the extreme displacement in the step 3.

Reading in this forum I realized there is a beautiful property called “vm_redice” (re-dice displacements) which according to the documentation fixes precisely this issue:

“With extreme displacement, it’s possible to get micro-polygons which are stretched far out of shape. Turning re-dicing on will cause the geometry to be re-diced after the geometry has been displaced. This will result in micro-polygons which have a much more uniform size and will most likely provide higher quality images. This is more costly since the displacement shader may be run multiple times during the projection process.”

The problem is that the re-dicing is performed (as far as I understood) ‘after’ all the ‘displace along normals’ nodes. Not after each one of them.
Which means there is no way to have a step…

4 - re-dicing

…which should cause the creation of *new* micropolygons (and new interpolated normals, uvs etc…) and *then* apply the second displacement.

5 - displacement 2

My question is:
Is there a way to force a real re-dicing every time a ‘displace along normal’ is performed?
If not…is it possible maybe to put two displacement shaders in series, before the pixel is shaded ?

thank you all in advance for every possible clarification on this topic

p.s.
in the simple render example it's present only the displacement 1, and i used a voronoi noise to perform the displacement ( I love voronoi )

Alessandro

Attachments:
frame1.jpg (27.0 KB)
frame2.jpg (105.3 KB)
frame3.jpg (26.1 KB)
frame4.jpg (118.3 KB)
frame5.jpg (20.3 KB)
render2.jpg (84.0 KB)

Alessandro Pepe
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
User Avatar
Member
1002 posts
Joined: July 2005
Offline
There's no way in mantra to run displacements in sequence as you describe - you'd need to build up the displacement layers in a single shader. Redicing just measures the size of the displaced geometry and makes a decision on how finely to dice the final mesh based on this trial evaluation, but it's running the same displacement in both cases (to produce the measured and final displaced points).

Andrew
User Avatar
Member
22 posts
Joined: June 2006
Offline
Hi Andrew,
thank you for your reply,

Yes i figured that within the same shader Mantra has to deal with the same geometry and within the shader there cannot be ‘new’ geometry created.

So basically, from the moment i press “render” on the mantra node, the dicing step is applyed always and only once, no matter how many displace along normals i add, is this correct ?

Or maybe is performed per shader ?
I was wondering if, in case it's performed per shader, maybe there was a way to stack/layer shaders in order to perform several real dicings (one per shader, and each shader contains only 1 displace along normal).

Thank you for shedding some light on the gigantic black hole of my ignorance about Mantra (which is the coolest render engine ever, there !)

andrewc
There's no way in mantra to run displacements in sequence as you describe - you'd need to build up the displacement layers in a single shader. Redicing just measures the size of the displaced geometry and makes a decision on how finely to dice the final mesh based on this trial evaluation, but it's running the same displacement in both cases (to produce the measured and final displaced points).

Andrew
Alessandro Pepe
http://www.alessandropepe.com [www.alessandropepe.com]
http://pepefx.blogspot.com [pepefx.blogspot.com]
  • Quick Links