Results 1 to 11 of 11

Thread: Clipping Images Instead Of Clipping Geometry.

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

    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:	30 
Size:	75.6 KB 
ID:	146614  

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,941
    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:	128 
Size:	434.5 KB 
ID:	146615
    Last edited by Sensei; 01-13-2020 at 03:50 PM.

  3. #3
    icon kid
    Join Date
    May 2006
    Location
    New York City, New York
    Posts
    33
    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
    7,941
    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:	95 
Size:	787.0 KB 
ID:	146620

  5. #5
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,941
    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:	95 
Size:	432.1 KB 
ID:	146622

    Click image for larger version. 

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

  6. #6
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,821
    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:	11 
Size:	1,013.4 KB 
ID:	146624 Click image for larger version. 

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

Name:	03_LWLogo_VPRShowsAlphaApplied.jpg 
Views:	10 
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:	11 
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
    33
    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:	7 
Size:	36.0 KB 
ID:	146644  

  8. #8
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,821
    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:	4 
Size:	75.4 KB 
ID:	146646

    The setup is:

    Click image for larger version. 

Name:	ImageWithB&WOpacity_Mixer_Setup.jpg 
Views:	5 
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:	3 
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
    33
    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:	5 
Size:	45.3 KB 
ID:	146661  
    Attached Images Attached Images

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

    Click image for larger version. 

Name:	UsingUploadedBMPFiles.jpg 
Views:	7 
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:	5 
Size:	1.37 MB 
ID:	146670

    What version of LW are you using?

    mTp
    Attached Files Attached Files
    Last edited by MonroePoteet; Yesterday at 05:44 PM. Reason: Add invert mask rationale and image

  11. #11
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,099
    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.

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
  •