PDA

View Full Version : Mental Ray Texture Projection


Kinematics
09-09-2008, 05:40 AM
Hey guys,

This is a Mental Ray Question. I've included a Jpg but its not very easy to understand just by looking at the image so I am going to do my best to describe my question.

I wanted a floating sign with the word "designed to" cut out of a reflective material (think a piece of paper with the words "designed to" cut out and then the two corners of the piece of paper is folded and stuck into a wall.

So I used an mia_x material and used the "cutout_opacity" option to map the alpha and using the projection option so that I can position the cutout. That all went fine and rendered well with the shadows being taken into account ( sidenote* reason why I cannot use the mib_transparency is cause rays seem to still see the surface and cast shadows unlike "cutout_opacity" )

But if you look at the image I have attached. Imagine the rectangle surface is across and as u can see...the projection (highlighted in a red square) does not cover the entire surface. As such the white areas take on the Mia_X material nicely. But the corners on both sides are left out.

How do I have one continuous material with the cutout included without doing another texture with a larger white area?

Hope you guys can help - I've tried mix_color and mib_transparency but it is all rather confusing and I am not getting the results I am looking for. Particularly in mental ray as this is where the difficulty lies. I can achieve this in Software renderer using the layered shader.

Thanks guys. Maya 2008.

YourDaftPunk
09-09-2008, 06:02 AM
In the place2D node, turn off wrapU and wrapV. On the projection node and on the file node, you can now pick the default color for the area outside the image, which would be black. Enjoy.

-shawn

Kinematics
09-09-2008, 07:58 AM
Geez. I really don't know my stuff. Your a life saver Shawn. Thanks.
While I have a chance, Let me drop another Mental Ray question.

How do I go about combinging two alpha projections and mapping that into the cutout_opacity attribute? I just tried using the mib_color_mix but no luck. I'm sure its going to be another one liner.

Thanks again Shawn. Seen your name on my replies like countless times by now. Really appreciate the help. My mental ray skills are pretty dodgy no matter how many times I read those mental ray docs and use F1 and search.

Cheers man

chronic
09-09-2008, 03:06 PM
the equivalent of cutout opacity is mib_continue, if you ever wanted to do a similar effect but use something other than the mia_mat

combine 2 projections: for black and white images try multiplying them or adding them depending on what you want (probably multiply)

YourDaftPunk
09-09-2008, 08:04 PM
Chronic is right, multiply is the way to go. Keep in mind that you can invert texture nodes in the effects section of their attributes- easier than going to photoshop for that change.


mib_mix_color should have worked. I wouldn't use it for just two textures though- it's not worth the overhead. Just to confirm you were doing it right, you should have had:

yourTexture1.outColor -> mib_color_mix.color_base
yourTexture2.outColor -> mib_color_mix.color_0

mib_color_mix Num set to 1.
mib_color_mix Mode0 set to multiply (or whatever you need).

mib_color_mix.outValueR -> mia_material_x.cutout_opacity
(not.outValueA, it throws an error)


That's a lot of work, so just use the mult utility node. You can however mix complete shaders with mib_color_mix node:

mia_material_x1.result -> mib_color_mix.color_base
mia_material_x2.result -> mib_color_mix.color_0
mib_color_mix.message -> someShaderGroup.miMaterialShader

Tobbe
09-09-2008, 09:53 PM
Or... By "combinging two alpha projections" you ment projecting two different images on different, non overlapping, places using the same shader? If so, just map the default color of that first projection node with another projection. And continue in a chain for as meny projections you want.

Cheers

CGTalk Moderation
09-09-2008, 09:53 PM
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.