PDA

View Full Version : Boolean Texture plug-in


Maxx
07-19-2003, 02:34 PM
Anybody using it? It sounds simple enough - apply to 2 objects, render. *Riiight.* Not working at this end, and any help/ideas from those using it would be greatly appreciated!

Steve Warner
07-19-2003, 05:31 PM
Hi Maxx. Fi's Junkbox (http://www.infoseek.livedoor.com/%7Ef_ichikawa/index.html) has a good fake boolean in the Shaders 4.1 pack. Here's the basic rundown on its use.

-----------------------------------------------------------------------------

*NOTE* For a tutorial on SHIFT's Fake Boolean, scroll down to the bottom of this page.

-----------------------------------------------------------------------------

You'll need four surfaces to pull off Fi's Fake Boolean. They are:

1. The Source surface. This is the object that will be affected by the boolean.

2. The Source Inside surface. Contrary to what you would expect, this is not the surface you'll see on the inside of the Source object. I'll explain more on this in just a bit.

3. The Target surface. This is the object that will do the cutting.

4. The Target Outside surface.

Of course, in order to get four distinct surfaces, you'll need four distinct objects. Here's a simple example to show you how to set this up.

In Modeler, create a box in the first layer. Give it a surface name called "Source."

Copy this box to a new layer. Flip the polys so that their normals face inward and give it a new surface called "Source Inside."

Now this is the important part. You must set the following surface attributes for the Source Inside object:

Color = pure black
Luminosity = 100
Diffuse = 0
Transparency = 100

Cut the Source Inside object from the second layer and paste it back into the first layer. You should now have what appears to be a simple box. But if you select it, you will find that it is really two boxes. One has its normals facing outward (this is our Source object) and one with its normals facing inward (this is our Source Inside object).

Now we're going to create our boolean object. For this example, let's create a simple sphere in layer two. Here's where it gets interesting. The surface of your Source object (the box) faced outward. But the Source Inside object faced inward. We need to do the opposite for our Target object. So begin by flipping the polys of your sphere so the normals face inward.

Now give it a surface name called "Target." Since this is a sphere, go ahead and turn on smoothing. And while you're at it, give this surface color something unique. If your box is the generic white, make this a bright blue. You'll see why in just a minute.

Copy the Target object to layer three. Give it a new surface name called "Target Outside." Now watch this. Since our Target object had its normals facing inward, our Target Outside object needs its normals facing outward. You're just doing the reverse of what you did with the Source object. So use the Flip command to flip the polys. Set it's surface the same as the Source Inside:

Color = pure black
Luminosity = 100
Diffuse = 0
Transparency = 100

Finally, cut the Target Outside from layer three and paste it into layer two.

You should have what appears to be a box in layer one and a sphere in layer two. Save your object.

Fire up Layout and load your object. Then bring up the Surface Editor. We need to apply the Fake Boolean shader to two of our surfaces: The Source and the Target. The Source Inside and Target Inside are alread set, and we don't need to do anything with them from here on out.

Apply the Fake Boolean shader to both your Source and Target surfaces. We're almost done, but first we need to tell the shader which object is the Source, which is the Target, and which layers they reside on.

With your Source surface selected, double click on the Fake Boolean shader. This will bring up two drop down options:

Effective Space: You have two options here. Outside and Inside. Outside is the Source object. Inside is the Target (or boolean) object.

Intersecting Item: This is where we specify which layer our Source and Target items are on.

Since this is our Source object, set Effective Space to Outside. And we need to tell it that our Intersecting Item (our Target object) is on Layer 2.

Repeat the process for the Target surface, but choose the opposite settings. Effective Space will be Inside, and Intersecting Item (our Source object) will be Layer 1.

As far as setup goes, that's it. You can now move your objects around and whenever the ball intersects with the box, it will cut it away. If you set your Target surface to blue, you will notice that anywhere that was cut leaves a blue surface. Contrary to what you would expect, the Source Inside is not actually what you will see on the "inside" of the box. Rather, this surface is necessary for the Target surface to show up.

From here, you can play with the surface settings for the Source and Target. As long as you don't tweak the Source Inside and Target Outside, everything will turn out fine.

Hope this helps!

Steve

Shade01
07-19-2003, 05:41 PM
Man, Steve, you are like a personal encyclopedia of plugins :)

Chewey
07-19-2003, 05:46 PM
wow! Talk about a comprehensive bit of plugin help.:thumbsup:

Steve Warner
07-19-2003, 06:10 PM
:)

I'm attaching a zip file with the objects and a scene built from the above description.

And here's a Divx 5.05 video sample (http://www.trinitymediainc.com/Help/boolean.avi)

Cheers!

Steve

Chewey
07-19-2003, 06:17 PM
Nice bit of demo there. It's nice to see that there are still other talented LWaver's that contribute to this forum.:thumbsup:

Maxx
07-19-2003, 06:20 PM
wow. Steve, you're officially my hero :thumbsup: . Thank you for the info! Man, I gotta admit I didn't expect a full-blown tutorial (let alone a movie example) from the question! Thank you! :applause:

richpr
07-20-2003, 01:02 AM
Great little tutorial there! thx

rickycox
07-20-2003, 04:51 AM
That's a cool technique on the video, will have to check it out properly.

adrencg
07-20-2003, 05:50 AM
Originally posted by Steve Warner
Hi Maxx. Here's the basic rundown:

You'll need four surfaces to pull off the Fake Boolean. They are:

1. The Source surface. This is the object that will be affected by the boolean.

2. The Source Inside surface. Contrary to what you would expect, this is not the surface you'll see on the inside of the Source object. I'll explain more on this in just a bit.

3. The Target surface. This is the object that will do the cutting.

4. The Target Outside surface.

Of course, in order to get four distinct surfaces, you'll need four distinct objects. Here's a simple example to show you how to set this up.

In Modeler, create a box in the first layer. Give it a surface name called "Source."

Copy this box to a new layer. Flip the polys so that their normals face inward and give it a new surface called "Source Inside."

Now this is the important part. You must set the following surface attributes for the Source Inside object:

Color = pure black
Luminosity = 100
Diffuse = 0
Transparency = 100

Cut the Source Inside object from the second layer and paste it back into the first layer. You should now have what appears to be a simple box. But if you select it, you will find that it is really two boxes. One has its normals facing outward (this is our Source object) and one with its normals facing inward (this is our Source Inside object).

Now we're going to create our boolean object. For this example, let's create a simple sphere in layer two. Here's where it gets interesting. The surface of your Source object (the box) faced outward. But the Source Inside object faced inward. We need to do the opposite for our Target object. So begin by flipping the polys of your sphere so the normals face inward.

Now give it a surface name called "Target." Since this is a sphere, go ahead and turn on smoothing. And while you're at it, give this surface color something unique. If your box is the generic white, make this a bright blue. You'll see why in just a minute.

Copy the Target object to layer three. Give it a new surface name called "Target Outside." Now watch this. Since our Target object had its normals facing inward, our Target Outside object needs its normals facing outward. You're just doing the reverse of what you did with the Source object. So use the Flip command to flip the polys. Set it's surface the same as the Source Inside:

Color = pure black
Luminosity = 100
Diffuse = 0
Transparency = 100

Finally, cut the Target Outside from layer three and paste it into layer two.

You should have what appears to be a box in layer one and a sphere in layer two. Save your object.

Fire up Layout and load your object. Then bring up the Surface Editor. We need to apply the Fake Boolean shader to two of our surfaces: The Source and the Target. The Source Inside and Target Inside are alread set, and we don't need to do anything with them from here on out.

Apply the Fake Boolean shader to both your Source and Target surfaces. We're almost done, but first we need to tell the shader which object is the Source, which is the Target, and which layers they reside on.

With your Source surface selected, double click on the Fake Boolean shader. This will bring up two drop down options:

Effective Space: You have two options here. Outside and Inside. Outside is the Source object. Inside is the Target (or boolean) object.

Intersecting Item: This is where we specify which layer our Source and Target items are on.

Since this is our Source object, set Effective Space to Outside. And we need to tell it that our Intersecting Item (our Target object) is on Layer 2.

Repeat the process for the Target surface, but choose the opposite settings. Effective Space will be Inside, and Intersecting Item (our Source object) will be Layer 1.

As far as setup goes, that's it. You can now move your objects around and whenever the ball intersects with the box, it will cut it away. If you set your Target surface to blue, you will notice that anywhere that was cut leaves a blue surface. Contrary to what you would expect, the Source Inside is not actually what you will see on the "inside" of the box. Rather, this surface is necessary for the Target surface to show up.

From here, you can play with the surface settings for the Source and Target. As long as you don't tweak the Source Inside and Target Outside, everything will turn out fine.

Hope this helps!

Steve

More difficult please!!!! I get off on convoluted plugins!

Mike

Steve Warner
07-20-2003, 09:03 AM
Actually the plug-in isn't difficult to use. The whole process of setting it up can be done in about two minutes. But explaining it in terms that anyone can understand and follow is not an easy process. That's what takes time. :)

Cheers!

Steve

aurora
07-22-2003, 02:16 PM
That is so COOL!!! Read and watched now all these ideas to try are popping in and out of my head. There goes what I had planned to work on today. Thanks Steve.
Oh Steve FYI, I think I'm going to create 2 seperate tuts one for landscaping and a different one using the NormalMapper. I caved and am doing the landscaping different now to get/keep the high detail fast and easy like (sorta). It will make more sense after I get them done.

aurora
07-22-2003, 05:28 PM
Man, Steve, your evil! I have been having a blast playing with this plugin instead of working on what I should be working on!
A couple of cool things I did with this:
1- Using morphing you can do some awesome tunneling.
2- You can make pretty cool holes in walls open up for things to come through and then close. So much easier this way!
3- Since they stay transparent and if you don't need alot of them this is a great quick/easy method for footsteps in sand/dirt. Just clone your object(once surfacing is done) and then match the cloned object to your foot colliding with the dirt then leave it there as the foot leaves. Repeat as needed.
4- Laserbeams/bullets entering objects.

Heres a few things I did this morning. What other things have some of you tried thought of?

Steve Warner
07-22-2003, 05:30 PM
Aurora, I can't wait to see your tutorials! They sound great! :) And I'm glad you're having fun with Fi's Fake Boolean. The footprints idea is fantastic!

Well, I had a chance to play with the SHIFT Fake Boolean plug-in this morning. WOW! You can get nearly identical results to Fi's Fake Boolean without all the troublesome setup. Here's a basic rundown of the SHIFT plugin.

If you've read the tutorial on Fi's Fake Boolean, you know that it utilizes a surface shader for the effect. SHIFT's Fake Boolean (http://www.shift.gr.jp/html/staff/plugin.html) takes a different approach by using a procedural texture tied to a clip map.

In Modeler, create a box in Layer 1. Give it a surface named "Box." In Layer 2, create a ball. Give it a surface named "Ball" and color it blue. We're going to follow the same setup as we did in the Fi's tutorial where we have the ball cut away portions of the box. So in this case, where the box gets cut away, it will leave the blue texture of the ball.

Save your objects and load them into Layout. Position the ball so that it intersects the box and set your camera so that you can see both objects.

Select the box and open its Object Properties panel. On the Render tab, click the "T" button next to Clip Map to open the Texture Editor. Change the Layer Type to Procedural Texture and the Procedural Type to the SHIFT_Boolean_Texture.

We now have a few options. Texture Value, Target Item, and In/Out.

Texture Value simply determines how bright the clip map will be. Since clip maps really only work with stark black and white images, lowering this won't really do anything. Go ahead and crank this value up to 100%. Lesser values will still work, but if you drop it all the way to 0%, it will have the effect of reversing the texture. So keep it at 100%.

Target Item. Since we've got our box selected, our target object will be the ball. Click the drop down and select Layer 2, the ball layer.

In/Out. This tells the procedural texture which way the normals of our Target object are facing. And this is the most important part of the setup. In order for the fake boolean to work correctly, the object that gets cut (in this case, it's our box) needs to have its normals facing outward. It already does, so we're fine. But the object doing the cutting (in this case, our ball) needs to have its normals facing inward. Currently, however, the normals of the ball face outward. Now here's the thing. We could go back to Modeler and flip the polys. But an easier way is to simply turn on Double Sided in the Surface Editor.

With the Clip Map Texture Editor still open, open up the Surface Editor. Click on the Ball surface and check the Double Sided checkbox. Close the Surface Editor.

Now that we know the normals for our ball are facing inward, go back to the Clip Map Texture Editor and change the In/Out setting to In.

Click "Use Texture" to close the Texture Editor, then change your object to the ball in Layer 2. Open up the Clip Map Texture Editor for this object and apply the SHIFT_Boolean_Texture. Once again, ramp up the value to 100%. Change the Target to Layer 1, the box layer. And since we know that our box's normals face outward, set the In/Out property to Out.

That's it. You're done! Do a test render and you'll see that the ball is now cutting away your box. :)

Scene files are attached for your convenience.

Cheers!

Steve

aurora
07-22-2003, 11:01 PM
Between the 2 plugins I definitently prefer the second one, Fake_Shift_Bool. Its faster and easier to use and I can do all the same things I can with the Fake Boolean Texture.

ASCIISkull
07-23-2003, 12:15 AM
Does anyone else get lots of nasty rendering artifacts with the Shift plugin?

aurora
07-23-2003, 12:22 AM
I have not seen any yet with either of these plugins. What are you doing with it and what kind of artifacts are you seeing?

Steve Warner
07-23-2003, 01:03 AM
I've noticed that if the In/Out setting gets reversed on the SHIFT plugin, it can result in some bad renders. Almost like the boolean object has been shredded. Also, I've noticed that on SHIFT's plugin, turning on Ray Traced shadows did occassionally produce artifacts similar to degenerate polys. Are either of these what you are getting?

Steve

aurora
07-23-2003, 02:38 AM
One other thing in addition to what Steve mentioned is a scene I tried with mirrored reflections. It also caused some artifacts. As a side note I have been able to get shadows and reflections to work with FIs_Fake_Boolean shader plugin without any artifacts,

kurv
07-23-2003, 09:36 PM
Awesome Steve, you should write a book :)

Wes -

aurora
07-24-2003, 04:13 PM
HERE - HERE!!!!!!!
Wes I like seeing your ideas more and more. So Steve what are you doing between 1am - 6am? A book just on LW plugins, there functionality and uses. That is a FANTASTIC idea. It could be a nightmare getting permissions and deals from all the authors but most of them would be pretty hip and excited about this. If you question the width and depth this could go we had wild peyote growing in our backyard about 10 yards from the gate behind the pool and slightly towards the minor ditch up on BearCreek Drive just a mile from Sabino High. Go get some play with some plugins and let the dreams commense. (FWIW, we never tried, in fact I never knew quite how to use it till I became a paramedic many moons later.)
Seriously think about I bet Wes would be more then happy to get you started. Right Wes hint, threat, hint! :thumbsup:

Steve Warner
07-24-2003, 05:52 PM
Originally posted by wordwarepub
Awesome Steve, you should write a book :)
Wes -
Hmmmm... That's not a bad idea. Maybe you could set me up. ;)


Originally posted by aurora
A book just on LW plugins, there functionality and uses.

Now there's an idea! What if rather than a book, I put together a website... say, www.lightwave3dtutorials.com and filled it with free plug-in tutorials?

Thanks for the support!

Steve

Kvaalen
12-06-2003, 12:20 AM
Originally posted by Steve Warner
Hmmmm... That's not a bad idea. Maybe you could set me up. ;)




Now there's an idea! What if rather than a book, I put together a website... say, www.lightwave3dtutorials.com and filled it with free plug-in tutorials?

Thanks for the support!

Steve

Sounds great to me!
I would't mind helping out a bit by making a couple tutorials if you want. :)

Steve Warner
12-06-2003, 12:34 AM
Awesome, Kvaalen! :beer: This is on the back burner at the moment, but I haven't forgotten it. I'll let you know once the I've got a hosting provider and start developing the site.

Thanks again!

Steve

kurv
12-06-2003, 03:38 AM
Steve, let me know what you would like, remember I own a hosting company :) (and do some development as well :thumbsup: )..

Let me know.

I was thinking of setting up a web site myself called .....well maybe I will anounce it AFTER I get the domain...

:beer:

Steve Warner
12-06-2003, 05:10 AM
Wes: :bowdown: That would be awesome! I'll give you a ring this weekend and we can talk about it then. :)

Happy modeling and texturing!

Steve

telamon
12-06-2003, 01:15 PM
I have just installed shift Fake Boolean but it seems I am not able to make it work on deformed object. I have tried endomorphs, shift spline transform and other deformation techniques and the result is the same, the "boolean operation" does not render.

Am I doing something wrong ?

LittleFenris
12-06-2003, 04:21 PM
telamon, have you tried the other fake boolean plugin to see if it works with endomorphs? maybe they don't work with endomorphs. ill have to try this out monday at work.

telamon
12-07-2003, 01:14 AM
not necessary to check. The other one works pretty fine.

I will give a try tomorrow to see if I can add celshader above the fakeboolean :D

Steve Warner
12-07-2003, 09:22 PM
telamon, glad you worked it out. Let us know how your results turn out!

Cheers!

Steve

telamon
12-07-2003, 11:50 PM
It does not work :blush: The cel shader does not work for the source object but does work for the target object.

Another thing, for important bendings, the fakeboolean shader takes much more time.

See the two pics below.

A bar,792 polys - rendering time = 1.8 s (no AA at all).
http://www.ifrance.com/telamon01/Boolean_Fake/nobending.jpg


The same bar bent by an endomorph - rendering time = 54 s/ It blocks on the step "rendering transparent polygons.
http://www.ifrance.com/telamon01/Boolean_Fake/Strongbending.jpg

I have tried to render image 2 from the same angle than image 1. But the renderer crashed :hmm:

LittleFenris
12-08-2003, 02:35 PM
man that sucks! i could have used this for my celshaded animation im working on, but if the cel shader doesn't work, im pretty screwed. :hmm: and taking THAT much longer to render with an endomorph is pretty crazy. :eek:

telamon
01-10-2004, 02:32 AM
Sorry for the late reply. I have just posted a feature request on Hrgiger thread "feature request for modeler" on NT forum. Hope Chuck and Proton will agree. It will become crucial for one of my jobs :bowdown:

slipster70
01-13-2004, 10:32 PM
Steve,
first of all, thank you for writing this tutorial on both of these plugins. Great stuff. I only just discovered the thread today and have found it valuable already. :buttrock:

Secondly, thank you Aurora for the idea of footprints and how to get them to "stay" there. :)

My question would be for wheel tracks in sand. How would you get an entire line of furrows, from a jeep for example, to stay there? I'm thinking that a transparent very long rectangle that follows the wheel would keep the indention, but if the jeep is turning this way and that, the morph target for the transparent object becomes more and more difficult to make!

Thanks for any ideas. Perhaps another plugin altogether?

Richard

telamon
01-13-2004, 10:43 PM
Why don't you use a displacement map instead ? You can apply an alpha gradient layer above and control it by a null.

Steve Warner
01-14-2004, 03:47 AM
Originally posted by slipster70
Steve, thank you for writing this tutorial on both of these plugins. Great stuff. My question would be for wheel tracks in sand. How would you get an entire line of furrows to stay there? Perhaps another plugin altogether?

Hi Richard,

Thanks for the compliment on the tutorials. I'm realy glad you found them useful. There are a number of different ways to get tracks in sand. Personally, I'd recommend using Worley's Acid Plugin (http://www.worley.com/polk/polk_acid.html). It's commercial, and that's always a turn off to some. But it's part of a larger pack of extremely useful tools, and it can do so many cool things. I used Acid to get the tire tracks on this Howitzer image:

http://www.trinitymediainc.com/WIP/Paladin/fixed01a.jpg

And I a also used it for the bullet holes in this image (which is a still from an animation):

http://www.trinitymediainc.com/Help/randomshots.jpg

If you're not interested in going with a commercial plugin, I'd recommend searching this forum for the terms "displacement map" or "animated bump map."

Hope this helps!

Steve

ASCIISkull
01-14-2004, 10:44 AM
I've still been unable to get SHIFT to work properly, even using your sample scene, Steve. I dunno what it is, but it keeps shredding the objects...

Anyways, has anyone had a problem with shadows and Fi's fake boolean?

ASCIISkull
01-14-2004, 11:19 AM
Originally posted by slipster70
My question would be for wheel tracks in sand. How would you get an entire line of furrows, from a jeep for example, to stay there? I'm thinking that a transparent very long rectangle that follows the wheel would keep the indention, but if the jeep is turning this way and that, the morph target for the transparent object becomes more and more difficult to make!

Took a little fiddling, but here's what I came up with:

First, make a box that has the right depth and width of the wheel, and as long as the path you want it to leave. Give it a lot of segments along it's length. Then, set up a line of skelegons, one for each segment. Make sure that the box, in this initial pose, won't be intersecting the ground.

Create a new endomorph, and in it move the entire box(but not
the skelegons) down so that the end of the box is at the beginning of the chain of skelegons.

Bring it to layout, and convert the skelegons to bones. Pose the bones to follow the path of the wheel. Also, make sure that the bones bring the box down to actually touch the ground. Once you have it looking good, with the fake boolean texture and all, use Motion Mixer to have the box follow the motion of the wheel, leaving the tracks behind the wheel.

Hope that helps, here's a short render-
http://aogcomic.keenspace.com/images/track01.gif
Track01.avi 283 kb DIVX (http://aogcomic.keenspace.com/images/tracks01.avi)

slipster70
01-14-2004, 04:57 PM
Thanks Mr. Skull!
That is a bad-ass solution.
And thanks for the tip on Acid, Steve. I am checking out the demo right now.

Steve Warner
01-14-2004, 08:39 PM
Originally posted by ASCIISkull
I've still been unable to get SHIFT to work properly,
That's really weird. Which one are you using? And when you run it, what happens?

Thanks!

Steve

ASCIISkull
01-14-2004, 09:15 PM
Originally posted by Steve Warner
That's really weird. Which one are you using? And when you run it, what happens?

Except for the shadow problem, Fi's works perfectly.

When using the SHIFT plugin, however, I have the problem you mentioned with the cutting object appearing 'shredded'. This happens whether shadows are on/off, antialiasing or no, adaptive sampling or not, and with every tweakable setting in the shader tweaked. I also tried using it as a shader in the transparency, but that gave the same rendering artifacts.

It even happened in the sample scene that you posted here.

Steve Warner
01-14-2004, 09:34 PM
That's really weird. But it may be a limitation of the plugin. I know telamon's been having troubles with it as well. I'm betting it's a limitation of the plugin, but if I find a way around it, I'll be sure to let you know.

Best regards,

Steve

CGTalk Moderation
01-15-2006, 04:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.