Invert normal for isosurface?

   4326   12   2
User Avatar
Member
271 posts
Joined: March 2012
Offline
Hi all,
I'm attempting to render out an isosurface of a volume, which I have done (see the attached image), but the issue is that I need the normals of the isosurface to be inverted and I cannot find any way to do this.
There doesn't seem to be a Mantra setting to do this, and I'm unsure how to alter the VDB volume itself to make this happen.
Does anyone know how this can be done?

Attachments:
mitochondria_render_16.jpg (74.0 KB)
mitochondria.hip (1.3 MB)

User Avatar
Member
319 posts
Joined:
Offline
Can you use the reverse sop?
User Avatar
Member
319 posts
Joined:
Offline
Do you mean like this?

Attachments:
mitochondria_163_reverse.hip (1.3 MB)

User Avatar
Member
271 posts
Joined: March 2012
Offline
Hi Dean - thanks for the reply

I was hoping to just render out the volume isosurface directly, which I've done in shopnet1>insides by setting properties for the;
  • vm_volumedensity
  • vm_volumeiso
  • vm_volumequality.
    All is correct except the direction of the isosurface normal

    I was hoping for a way to do this without changing my entire volume workflow.
User Avatar
Member
319 posts
Joined:
Offline
Oh right!

No, I'm not sure how to do that. I thought maybe inverting the SDF values with an volume wrangle (so inside becomes outside and vice versa) might produce an isosurface facing inward, but it didn't seem to change the render…
User Avatar
Member
271 posts
Joined: March 2012
Offline
Yes, I had the same idea. Doing something like
@density = 1-@density;
But I'm not sure that the VDB volume uses the same name (@density). Also that would possibly put a solid box around the outside.
I feel like there must be a way, I'm just missing something.
User Avatar
Member
8531 posts
Joined: July 2007
Online
yes, do volume wrangle to flip the values:
@surface *= -1;

then either check Backface Removal on your object (Render/Geometry tab)
or add that property directly to your shader and enable
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
319 posts
Joined:
Offline
Cool, nice one Tomas.

You access volumes with the volume wrange just by using @ followed by whatever your volume is called.
User Avatar
Member
8531 posts
Joined: July 2007
Online
Dean_19
Cool, nice one Tomas.

You access volumes with the volume wrange just by using @ followed by whatever your volume is called.

yes, and the same rules apply as for attributes so if it's not a float volume you should specify the type, like v@vel = {0,1,0};
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
271 posts
Joined: March 2012
Offline
tamte
yes, do volume wrangle to flip the values:
@surface *= -1;

then either check Backface Removal on your object (Render/Geometry tab)
or add that property directly to your shader and enable

Marvellous, that does indeed seem to do…something I still need to work on my shader, but it's good to know.
One question is how you found out that the @surface variables even exists?
In any case - thank you.

Another query I have (not sure whether to start a new thread or not) is about displacing the isosurface volume - I have tried both a shader displacement and a volume VOP displacement (if that even affects VDB volumes?), neither of which had any effect.
Is it possible to displace an isosurface volume at all?
User Avatar
Member
8531 posts
Joined: July 2007
Online
@surface is just a reference to volume called surface
if you middleclick on your geo you will see the names for your volumes, like density, surface, vel, rest, fuel, whatever

for example if you create VDB volume using vdb from polygons, Distance VDB creates by default sdf volume named surface, Fog VDB defaulds to name density, you can rename them as you want

to displace SDF volume (whether VDB or classic volume) in SOPs you can just add or remove the value
so @surface += 0.1; will offset the surface inwards by 0.1
you can of do the same in cvex shader if you are using volume procedural

but in theory displacing in material or displace shader should work too as that shader is already getting geo from procedural so it should be able to displace it normally
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
271 posts
Joined: March 2012
Offline
I tried to displace using the @surface + something;, which was able to make minor changed before the surface disintegrated and vanished (see attached file).

The sort of displacement I'm after is quite significant one. In the file you can see a long capsule shaped object…is it possible to get it to, say bend 45 degrees (or equivalent magnitude noise deform)?

Thanks for the help so far - I really appreciate it.

Attachments:
mitochondria.hipnc (1.3 MB)

User Avatar
Member
8531 posts
Joined: July 2007
Online
the amount you are able to expand is limited by the narrow band of your VDB
so if you want to offset more, you have to define larger band in VDB from Polygons

as I can't submit the file now here is the description:
1. in your vdbtopolygons1
- check Use World Space For Band (just so you see real distances for your bands)
- set Ext/Interior Band to >= max distance of your displacement, like 0.2
2. in vdbcombine1
- change Resample to B to Match A, just so that we are using bands from A as we just set them
3. adjust the offset in surface_offset, now your range is -.2 to 0.2, if you want more increase bands in 1.

and of course you can as well use some procedural noise as an offset to make it more interesting
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links