PDA

View Full Version : Textureing>Projection Node


4dartist
04-13-2004, 01:24 AM
This question probably has a very simple answer, but after working hard on it for 4 hours, i still can't seem to find the answer.

My goal is to Project a small image onto an already made shader.
I have a white metal shader, and i want to texture a small warning label on the metal. Sounds easy, probably is.

I would like to use a projection node to project the image where i need it, instead of putting a face there and texturing that face.

Heres what i did. I project a color img in the right direction using a projection node, i plug that into the Color channel on a Lambert called LABEL. I take my metal shader called WHITE, and put them into a layered shader and put the LABEL ontop of WHITE.

Now i just need to get everything around the label transparent so i can see the WHITE under it. ... i can't seem to get it right.

I tried taking the outAlpha(which is just a black alpha) and pluging that into the Transparency R and Transparency G and Transparency B of the LABEL shader. It almost works but there is a haze left over on the layer and the areas that should just be showing WHITE look different.

I tried using just a black image projected in the same manner to drive transparency on LABEL, but it still does the same thing.

The only thing i can think of selecting a face, applying the Layered shader to it, and ALL other faces of the object have the WHITE shader on it. Then on the LABEL shader i have the image of the label the size i need it (smaller than the face) and make an alpha image (bigger than tha face) that way the boarders of the image dont mess up my transparency.. That would work i think, but in the end is going to cause a lot more work.

Any help would be great. Thanks

Benjamin

djx
04-13-2004, 03:38 AM
The layered-shader has two different modes. One is called "layered shader", the other "layered texture" (Im not talking about the layered-texture node here).

In "layered-shader" mode, the specularaity of the layered materials is not affected by the alpha-channel (maybe this is the 'haze' you are seeing). If you switch to "layered texture" mode, the alpha should work the way you expect.

Epicentre
04-13-2004, 05:54 AM
give this a shot... it should give you the results that you are after or what i think you are trying achieve.

create a new blinn material, blinn is suitable for its metallic appearance. create a layered texture. drag the layered texture onto the blinn material and connect to color.

on the layered texture node you will need to add another layer (click inside the red outline rectangle). add as many layers as you need but two will do what you want. with the layered texture, the top layer is the furthest to the left and the bottom layer is on the far right.

select the bottom layer, set the blend mode to none, and map your metal file texture to the color attribute.

now select the top layer. change to blend mode to add and map the label file texture you want to the color attribute. reuse the same file node to map the alpha output from the label file to the top layer's alpha attribute.

you can adjust the texture placement of your label with the interactive placement tool or modifying the place2dTexture node. finally on the label file texture node set the default color to black. this is important because adjusting the coverage with the texture placement would have exposed the default color surrounding the label. as the blend mode is add and setting the default color to black doesn't alter the layers below. this could be cause for that haze you were talking about.

to view your result better in the viewport change (in the attribute editor) the blinn material hardware texturing quality to high.

hope this helps you out. don't worry 4 hours is time well spent when you are learning maya.

pasto
04-13-2004, 08:56 AM
it can't be the problem of specular since Lambert doesn't have any. Could be the default color of your label file node, turn it to black and try again.
For this purpose you should use a layered texture imho, as you don't need any specular mix etc.

pasto

djx
04-13-2004, 12:09 PM
pasto, it could be that the metal material has some specular. Even though this is his base layer, the lambert on top will still show this specular (from the lower layer) unless the shader is set to "layered texture mode".

I didnt mention before that if your top layer has incandescence, then you may need to make special considerations depending on how you are using it.

I usually connect the top layer material via drag-n-drop, but then I reconnect the transparancy (file texture or whatever) directly to the layered-shader. Put another way, I keep the "fill" and the "mask" independant. Doing so (in layered texture mode) means the transparancy channel (the mask) will correctly cut-out the top layer's color, specularity (if it has any) and incandescense.

I would use a layered-texture only if I wanted the same material for the base and the decal (but often I dont).

pasto
04-13-2004, 12:45 PM
Oh yes sorry the specular of the blinn can be over the lambert, you are right. Sorry if I confused anybody.

pasto

valkyri
04-13-2004, 03:18 PM
Originally posted by Epicentre

create a new blinn material, blinn is suitable for its metallic appearance. create a layered texture. drag the layered texture onto the blinn material and connect to color.

on the layered texture node you will need to add another layer (click inside the red outline rectangle). add as many layers as you need but two will do what you want. with the layered texture, the top layer is the furthest to the left and the bottom layer is on the far right.

do your mean a shade to add more than one texture ?
I want to do it.
where is the red outline rectangle ?

4dartist
04-13-2004, 03:39 PM
djx - i can't even get it to work with 2 lamberts. But i did try the layered texture option on the bottom of the Layered Shader node.

Pasto - on some of the tutorials i have done on Highend3d.com the guy turned the default color to black to fix a problem he had of the areas around the image being to bright, (my problem) and i did the same but it never took away haze.

Epicentre - I made the shading network you described. And the base color was close maybe a little bright again, and the sticker was also hazed over. Brighter than it should be, i used IPR and tried every option in there. ADD/OVER/Mulitply etc. Heres what it looks like.. i just tried this one label, i have quite a few i wanted to do this way.
http://www.4dartist.com/cgtalk/example.jpg

Gearbox1 is just giving its Outcolor to the 2nd layer in the layeredTexture. And Gearbox is getting only its color from the layered Texture. The projection node is giving its color to the color of 1st Layer in the layered Texture. I then used add mode and any other options i could find in there.

I have tried this without the projection and i noticed that the Default color actually changes the color around the image. So i used the Projection node again, and tried the default color on the projection, nochange, then i tried the default color on the image while still hooked up with the projection and it did start making changes.

SOOOoo. Finally after about 5 mins of testing, i got what i think worked. I put the default color of the FileImage node to white, and changed the blendmode on the layered TextureNode to illuminate.. and i got this.
http://www.4dartist.com/cgtalk/working.jpg
Thats pretty much what i was going for. 8)

Ill try it around the model on areas i needed it, and hopefully it holds up. 8) thanks guys for the help so much. Last night my brain was sputtering there at the end. I couldn't think, the rest helps hehe.

Benjamin

4dartist
04-13-2004, 03:44 PM
HAHA -- Pasto, i went back to my old file that i was trying this on with the layered shader to look at the default color on the "FILE NODE" and you were right that seemed to fix it.. MAN! o MAN! all night i had been fiddling with the Projection Nodes default color, i didn't even think about the file node, i read your post and it didn't even dawn on me that you were talking about the imagefile node.. shesh.. sorry man your way worked too. Awsome, you don't know how happy this makes me lol!

:rolleyes: What a dork i am.

Thanks! :thumbsup:

pasto
04-13-2004, 04:42 PM
So happy to help you on this.
I have searched a lot myself, Maya is quite deep in materials.

pasto

CGTalk Moderation
01-18-2006, 12:00 AM
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.