Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   How do you properly attatch a alpha via projection and layered texture? (https://simplymaya.com/forum/showthread.php?t=28404)

gubar 05-12-2007 11:35 PM

How do you properly attatch a alpha via projection and layered texture?
 
Hi,

been trying many ways... from the file to the material (blinn)... from the material to the layered texture alpha... copying the projection, and trying to hook it in through there (several ways to do it, none obvious or working properly).

The closest I can get, is that I can manipulate the placement node, and see my text... but when I render, it's in a different place - something to do with my alpha not moving with my image (the text that I'm projecting is white too).

Anyone able to help?

thanks,

gubar

Mayaniac 06-12-2007 12:43 AM

I'm not quite sure what your getting at, but it sounds like your using one image as your Color image, another as the Alpha image. You shouldn't do that, they should all be one image.

If your trying to project an image you probably wont have to much luck, projections can be Ugly and take time to set up, and if you move your Object the texture doesn't follow.

I would use "Normal" as my option for 2D textures. Then it should map to your plane just fine. I just through a quick test together in Maya and it works fine.

So, make sure your Alphas are created correctly, and don't use a projection unless you have to.

Post back if it's still not working.

:beer:

gubar 06-12-2007 12:49 AM

Hi thanks for taking the time to post.

It works fine with a mapped texture. However, I am projecting the texture because it is comprised of text so its aspect ratio is important, and the object is oblong; making non-square textures that preserve their proportions is not easy with maya, unless you just make a square texture and leave a lot blank, thich is not efficient (though I'd be happy to be shown a way to make a rectangular texture easliy).

The reason I have made two files is because I tried it with one, and it doesn't work - the 3d projection node does not have the expected input to take an alpha for some reason. So you try and hook another file into various inputs... I've been at it for a good few hours.

thanks for having a go,

gubar

Mayaniac 06-12-2007 01:08 AM

Hmm, i see what your saying, but i think i know of a way you could do this, and keeping your Images Hight/Width ratio.

So, let me give you an example of what i think your trying to do:

Lets say you modeled a Bar of Soap (or something else that was oblong in shape) and you are trying to project text onto the side of it, but don't want it's funny shape to ruin or warp the text.

Does the above sound like what you are trying to do?

If so i might have a cure, but it's hard to discribe. I would have to post a couple of images for you to follow. (which i wouldn't mind doing) but i don't want to do it if i'm not talking about the right thing..... you know what i mean?

Anyhow, post back if you now what i'm talking about and also correct me where i'm wrong.

Have fun! :beer:

gubar 06-12-2007 09:38 AM

Hi Mayaniac,

that sounds pretty much what I'm going for. I'm modeling a VCR which is rectangular as viewed from the front.

I want to project all of the text from the front, using an alpha channel to only project the text (the other layer will have to material's main texture).

I've tried maintaing the aspect ration but it's quite tricky... if you know how, that'd be great.

thanks,

gubar

Mayaniac 06-12-2007 02:09 PM

Ok, here goes nothing....

Select the Faces on the front of your VCR (the ones you want the texture applied to) and then change to your Front view, or the view that faces the the Selected faces.

Now before we go on. With the faces still selected go to:
Create>> Sets>> Quick Select Set...
Name it accordingly, and hit "Add to shelf"

Now you should have a button on your shelf that every time you click, it selects the faces on the front of your VCR.

Now with the Front faces selected and in the front view go to: Create UVs>> Planar Mapping (select the options Box) Now in the Option: Select "Bounding box" (not best plane.) and select "Camera" Now Also select "Keep Image Width/Hight Ratio" and also select: "Insert Projection Before Deformers." Then click "Project."

Now go to Window>> UV Texture editor.

You should see the UVs for the Front of the VCR which have not lost it's Aspect Ratio. Select the UV for the front of the VCR and move them of to the side, and then select the UVs for the rest of the VCR and move them of to the other side, then bring the Front VCR UVs back into the center. This will make sure that non of the text you apply to the front of the VCR appears on the rest of it.

Now in the UV texture editor go to: Polygons>> UV Snapshot...

Now the Snapshot options dialog box should pop up.
Just fill in the Details according to your preference.
Such as, 1024x1024 for the image size, and PNG for the format, also change the color value to blue or something equally as visible.
Now with the dialog bx still open select your VCR (in object mode) and then Click "OK" in the Snapshot Dialog box.

Open your UV snapshot in Photoshop, and make sure your text lines up the UVs.

Now save your Alpha image as a .Targa or .PNG

Now back in Maya open the Hyper Shade (Window>> Render Editors>> Hyper shade.)

Now in the Hyper shade, create a new Node and double click it to open the attribute Editor.
In the color channel click the checker box. when the "Create Render node" Dialog box opens. Make sure to select "Normal" not "as projection" or "as Stencil"
Then click the "File" node.

Now in the attribute editor, click on the small file icon next to image name to browse and select your image.

Now apply the texture to your VCR. Hit 6 on your key board to see the results.

Now you may notice that the image is showing up on the rest of the model.

Well thats an easy fix. Create a New node in the Hyper shade and apply it to the rest of the VCR (excluding the front.) This will keep things nice and clean while you complete the rest of the steps.

Now to achieve the effect that you are after you will need to create a Layered shader, and plug-in your textures.

To do this Open the hyper shade and crate a "layered shader" node. Double click it to view it's attributes. Now you should see a Red box with a small green Box inside of it. Now middle mouse button and drag the Base texture you want applied to the whole VCR into the Red box in the Layered Shaders attributes. Click the small x underneath the green box to delete it. Now Middle mouse Button and drag the Node with the Alpha image applied into the Red box also.

NOTE: Make sure that the Base texture is first followed by the image texture in the Layered shaders red box. This is very important if you want your Alpha image to show up.

Now apply the Layered shader to the Object. You wont be able to see the results in the view port any more, and will have to do Render to see them.

Now if the Alpha text is showing up on the model in any other place than the front of the VCR, Open the Hyper shade and select the base texture node, and in the hyper shad go to: Edit>> Duplicate>> Without network.

Now select the all the faces of your VCR (excluding the front) and apply this new Node.

NOTE: A quick way to select all those faces without selecting the front faces, is to use the Selection set you created earlier. Click on the Selection set button you put in the shelf, and this should select the front faces, now simply go to: Edit>> Invert selection.

Now this should give you the results that your after.

I hope this helped.

Take care :beer:

gubar 08-12-2007 10:24 AM

Hi Mayaniac,

thanks so much for taking the time to do that for me.

I'm still running into problems though... I've decided just to make the texture all in one layer, which is annoying cause I wanted to use a procedural for a bump map (still could if I create it and turn it into a file texture I suppose).

Gotta say, as much as I love maya I think it's pretty lousy that doing something as simple as projecting a texture with an alpha is so unintuitive and complex... it really should be a no brainer. All that the projection node needs is a proper way to pipe your alpha through, doesn't seem like a lot to ask for.

Anyway,

thanks,

gubar


All times are GMT. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018