Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Clipping Images Instead Of Clipping Geometry.

  1. #1
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46

    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.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	trans_demo.png 
Views:	43 
Size:	75.6 KB 
ID:	146614  

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,070
    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.



    Click image for larger version. 

Name:	Mixer Example.png 
Views:	198 
Size:	434.5 KB 
ID:	146615
    Last edited by Sensei; 01-13-2020 at 02:50 PM.

  3. #3
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46
    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. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,070
    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.



    Click image for larger version. 

Name:	Grab.png 
Views:	166 
Size:	787.0 KB 
ID:	146620

  5. #5
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,070
    Do you want it to have it smaller and positioned?

    Use U Tiling Reset and V Tiling Reset.





    Click image for larger version. 

Name:	Grab 3.jpg 
Views:	170 
Size:	432.1 KB 
ID:	146622

    Click image for larger version. 

Name:	Grab 2.jpg 
Views:	171 
Size:	432.2 KB 
ID:	146623

  6. #6
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,855
    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.

    Click image for larger version. 

Name:	01_TextureShadedSolid_NoAlpha.jpg 
Views:	18 
Size:	1,013.4 KB 
ID:	146624 Click image for larger version. 

Name:	02_LWLogoDisabled_VPRShowsProcedural.jpg 
Views:	17 
Size:	894.5 KB 
ID:	146625 Click image for larger version. 

Name:	03_LWLogo_VPRShowsAlphaApplied.jpg 
Views:	18 
Size:	926.1 KB 
ID:	146626

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

    Click image for larger version. 

Name:	04_MovingImageTakesAlphaWithIt.jpg 
Views:	19 
Size:	923.2 KB 
ID:	146627

    mTp
    Attached Files Attached Files

  7. #7
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46
    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?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	trans_demo-2.png 
Views:	15 
Size:	36.0 KB 
ID:	146644  

  8. #8
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,855
    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).

    Click image for larger version. 

Name:	ImageWithB&WOpacity_Mixer_LWLogoWithMarbleBkg_0000.jpg 
Views:	9 
Size:	75.4 KB 
ID:	146646

    The setup is:

    Click image for larger version. 

Name:	ImageWithB&WOpacity_Mixer_Setup.jpg 
Views:	10 
Size:	1.38 MB 
ID:	146647

    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:

    Click image for larger version. 

Name:	ValidAlphaChannel_SimplerNodeSetup.jpg 
Views:	9 
Size:	1,014.0 KB 
ID:	146650

    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. #9
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46
    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.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	trans_demo-3.png 
Views:	11 
Size:	45.3 KB 
ID:	146661  
    Attached Images Attached Images

  10. #10
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,855
    Works fine for me on LW 2019.1.5 using your uploaded BMP images:

    Click image for larger version. 

Name:	UsingUploadedBMPFiles.jpg 
Views:	17 
Size:	1.41 MB 
ID:	146668

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

    Click image for larger version. 

Name:	InvertMaskSinceWhiteIsOpaque.jpg 
Views:	14 
Size:	1.37 MB 
ID:	146670

    What version of LW are you using?

    mTp
    Attached Files Attached Files
    Last edited by MonroePoteet; 01-16-2020 at 04:44 PM. Reason: Add invert mask rationale and image

  11. #11
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,172
    Quote Originally Posted by icon kid View Post
    ...however, no node thumbnail is shown...
    Could be your refresh option in node editor, is it set to automatic?

    Denis.

  12. #12
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46
    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.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	trans_demo-4.png 
Views:	8 
Size:	76.5 KB 
ID:	146678  

  13. #13
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,070
    Quote Originally Posted by icon kid View Post
    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..
    Last edited by Sensei; 01-17-2020 at 08:56 PM.

  14. #14
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,855
    The earliest version of Lightwave I still have installed is 11.6, here's the node setup for it using your uploaded files:

    Click image for larger version. 

Name:	LW11.6_CocaColaOnMarble_Mixer.jpg 
Views:	14 
Size:	1.30 MB 
ID:	146679

    and here's just the Node Editor portion:

    Click image for larger version. 

Name:	LW11.6_CocoColaOnMarble_NodesOnly.jpg 
Views:	7 
Size:	590.8 KB 
ID:	146680

    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. #15
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    46
    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?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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