# Thread: Clipping Images Instead Of Clipping Geometry.

1. ## Clipping Images Instead Of Clipping Geometry.

I'm not understanding how to clip away parts of a projected image without clipping away parts of an object it's projected onto. The diagram attached illustrates this. If you take a polygon (A) and project a color channel onto it (B) along with a corresponding alpha image consisting of black for fully opaque and white (green just for illustration) for fully transparent (image not shown) the rest of the marble rectangle disappears (C). That's what is supposed to happen and I've used this many times in many projects. However, I want to clip only the image and leave the geometry unaffected by the image mask (D). I thought that using nodes would allow me to do this but, somehow, it's just doing the same thing as the standard "pre-nodes" surfacing tools. There are at least three work-arounds to this, and I've used each of them from time to time but they all have draw-backs. (1) -- Have the marble and the logo in the same image. (2) -- Create a round polygon inside the square one and project the logo onto it. (3) -- Create two polygons on the same plain, then put a transparency map on the marble to produce an apparent hole, and then apply a negative of that map on the logo -- this eliminates any "Z" conflict because where any spot on the marble polygon is opaque the same spot on the logo polygon is transparent, and vice versa.

2. Did you try using Color Mixer node.. ?

Plug 1st image node to Bg Color, 2nd image node to Fg Color in Mixer,
plug alpha mask image node to Opacity.
If alpha mask = 0% (black), output from mixer will be from Bg image node,
if alpha mask = 100% (white), output from mixer will be from Fg image node.

3. Thanks. It's interesting, however, it's still not as flexible as using a slider or numerical input to change the position of one image over another. That's because if (in my example) I wanted to move only the logo a little to the left (let's say) I would have to make a change to the foreground image (to increase the canvass size of the logo background) to allow for this. Anyway, I haven't checked out the mixing node yet. I'll experiment with it and I will surely make a reply post this coming weekend.

4. Add two Image nodes (or one Image node and procedural, like I did). Image with alpha has plugged something to Bg Color input.

They will mix together, based on alpha channel of image.

5. Do you want it to have it smaller and positioned?

Use U Tiling Reset and V Tiling Reset.

6. Be sure to use VPR to observe the Surface if alpha / masking is included. The Texture Shaded Solid mode doesn't apply the alpha channel.

If that doesn't work, you might also try an image format other than PNG. I've found that masks / alpha channels in PNG files are quite strange. If you can, try using a TIFF or TGA format for images containing alpha data. Or figure out what transparency in PNG files works with LW.

Sample LW2019 attached with a TGA file containing an alpha channel, which does what I think you want.

When the Position of the LWLogo image is moved in the Texture channel, the alpha channel goes with it:

mTp

7. I've gotten more suggestions than I was counting on but it takes time for me to fully understand each technique. I experimented with the Mixer node and the attached diagram shows my first result. As you can see, all five node thumbnails are completely black which is an issue in itself because the images for the three image nodes are loaded. There is probably a simple reason for this but, firstly, I want to know if the setup is correct. The marble image (which is an image, not a textural) is supposed to cover the gray polygon and is plugged in the "Bg" of Mixer. Next, the Coca-Cola logo image is plugged into the "Fg" of Mixer. Lastly, the mask (an 8-bit image) is plugged into Mixer Opacity to clip the green areas away from the logo. All three images are BMP format (two 24-bit and one 8-bit mask, and I should get the composite image as shown in the Mixer node (as well as in the Surface thumbnail). If my node configuration is correct then why is it showing black thumbnails and no effect on my gray polygon?

8. I think the Alpha channel in your BMP files is broken. There are some online articles about PhotoShop breaking alpha support in BMP files. You might try saving as TIFF or TGA.

Attached is a LW2019.1.4 scene, ImageWithB&WOpacity_Mixer_LWLogoWithMarbleBkg.zip, which has the same node setup you posted, which works fine for me. I disabled the Alpha channel in all my images using the Edit Image, and had to invert the Black&White opacity mask (White is opaque, Black is transparent).

The setup is:

If you disable the Alpha channel in your images and suddenly the thumbnails appear, it would seem to verify that the Alpha channel is broken in your images (or inverted?).

If your Coca Cola image has a valid Alpha mask the node network can be simpler, with the marble Image texture being fed directly into the Coca Cola Image's Bg Color and the mask will be correctly applied:

The simpler node setup allows the placement of the image to be changed while the Alpha channel follows along automatically. In the case of this sample animation, the X position of the image is oscillated over time:

ImageWithAlphaLayer_LWLogoWithMarbleBkg.mov MOV file

I've also attached the sample scene for this (ImageWithAlphaLayer_LWLogoWithMarbleBkg.zip) with the images containing valid Alpha channels.

mTp

9. I tested the TGA image format in an image node and I got the same results as when I used BMP. I loaded a marble image into the node, and it properly appears in the parameters box on the left. The polygon to be wrapped has only X,Y dimensions so the image is projected in the Z axis and sizing is automatic, however, no node thumbnail is shown. The rest of the techniques offered are still confusing to me. I'd like someone to take my three test images to try to produce the result I'm looking for and show me a screen shot of the setup used for it. That's the best way for me to see how it's done. All you need to do is make one square polygon of any size and use my images. All are 505 pixels square. Marble.bmp is the background image, Coca-Cola.bmp is the foreground image and mask.bmp cuts away the green portions of the logo.

10. Works fine for me on LW 2019.1.5 using your uploaded BMP images:

The B&W mask image has its Color inverted in the Image node since White makes the Fg Color opaque:

What version of LW are you using?

mTp

11. Originally Posted by icon kid
...however, no node thumbnail is shown...
Could be your refresh option in node editor, is it set to automatic?

Denis.

12. Thank you, MonroePoteet. With your help I've made some progress. I was still perplexed by the blank node thumbnails. I clicked around until I hit the "Options" button and then hit "Preview Options" and then "Disable Previews." This caused all my images to suddenly appear in the nodes! This also alludes to a suggestion by forum member "dpont" that "...[it] could be your refresh option in node editor." My setup is not complete, though, because your screen shot is too blurry to see what some nodes are plugged into, in addition to some parts of it being clipped. Tell me what they are (see my diagram). Next is a question about Preview Settings. In your screen shot, images (1), (2) and (3) are displayed as squares (like a front-facing cubes). In mine, they are projected onto a sphere. I looked for a setting that would make the previews cubic but I couldn't find it. Lastly, an oddity (which may not even affect my final result) is that the combined three images in the mixer node in my setup shows the logo on three sides (which I'd suppose would be visible on six sides if the preview itself could be rotated) whereas, on your's, the logo appears only on one of six possible sides with the rest being black, empty spaces. Again, this may mean nothing to my final result. By the way, I've been asked what LW version I'm using -- it's 9.2.

13. Originally Posted by icon kid
Thank you, MonroePoteet. With your help I've made some progress. I was still perplexed by the blank node thumbnails. I clicked around until I hit the "Options" button and then hit "Preview Options" and then "Disable Previews." This caused all my images to suddenly appear in the nodes! This also alludes to a suggestion by forum member "dpont" that "...[it] could be your refresh option in node editor." My setup is not complete, though, because your screen shot is too blurry to see what some nodes are plugged into, in addition to some parts of it being clipped. Tell me what they are (see my diagram). Next is a question about Preview Settings. In your screen shot, images (1), (2) and (3) are displayed as squares (like a front-facing cubes). In mine, they are projected onto a sphere. I looked for a setting that would make the previews cubic but I couldn't find it. Lastly, an oddity (which may not even affect my final result) is that the combined three images in the mixer node in my setup shows the logo on three sides (which I'd suppose would be visible on six sides if the preview itself could be rotated) whereas, on your's, the logo appears only on one of six possible sides with the rest being black, empty spaces. Again, this may mean nothing to my final result. By the way, I've been asked what LW version I'm using -- it's 9.2.
We are using 2019.x.
In your case plug output color from mixer node to color input on the far right or to diffuse shading. You don't have to obey color to color or scalar to scalar or vector to vector, if you don't want. You can plug color to scalar, or scalar to color, or color to vector or vector to color. Experiment without limits and you will learn nodes.

Ignore what is on preview. Rely mostly on final render F9..

14. The earliest version of Lightwave I still have installed is 11.6, here's the node setup for it using your uploaded files:

and here's just the Node Editor portion:

In the LW forum if you click on the image thumbnail above you'll see it in a viewer. If you click on the image in the viewer you'll get a full-page view, and you can click on the full-page view to see it at 100% and scroll around (if needed) in your browser. Hopefully one of these zooms into the image will provide a clear view.

Once again, I inverted the B&W mask since I think of the Marble as the background and the Coca Cola logo as the foreground. In LW11.6, I had to use the Invert button in the Image Editor rather than the Invert button in the node itself (for whatever reason) - maybe an 11.6 bug that's since been fixed. If you'd rather not invert the mask, you can make the Coke logo the Bg Color and the Marble the Fg Color.

The Principled BSDF node and the Surface node which takes a Material input were introduced in Lightwave version 2018, so they're not available in 9.2 and you'll just plug the Mixer color output into the Surface color input. I don't think the V9.2 node editor allowed changing the spherical representation in the node editor to the flat panel view. If you're seeing the logo on all sides of the cube, I think your mapping is Cubic rather than Planar in the Z axis, which is what I set up.

Good luck!
mTp

15. Ureka! Thank you again "MonroePoteet," (this set-up works for me). One last question: Surfacing with nodes in Modeler does not display. I can only see the texturing I've created in a Layout rendering. Is this how it's supposed to be? -- the same way that bump textures can not be displayed in Modeler?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•