CGTalk > Software > Autodesk Maya > Maya Rendering
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-19-2013, 10:04 PM   #1
MrFrags
New Member
 
MrFrags's Avatar
portfolio
Mathias
London, United Kingdom
 
Join Date: May 2011
Posts: 10
Maya Shader Networks request

Hey all, I'm trying to figure out how to create a special shader in Maya.

The Idea is pretty simple, I want to use a distance based shader in order to be able to separate two areas. Then, I apply an ambient occlusion shader in one area and another one in the other area.



Now, we can easily do this with the "lightInfo" node connected to a condition node. We've got the 'target' mesh where we apply the shader and, we've got another one used to determinate the area that we want to isolate. This mesh is connected to the lightInfo node, and his coordinates are used to the computation.



The problem is the lightInfo node use only the center point of the object instead of the shape itself to pick information.



Is it a way to use the shape of an object to achieve the same effect ?
+ is it possible to create a kind of falloff between the two areas ?
 
Old 05-22-2013, 12:26 PM   #2
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
I have seen such things with the use of fluid shapes, where you can just query the luminance to drive the same kind of thing.

but in any case, why not a projection with a radial ramp from top?
but yes maybe because it's not in x,y,z space.

then look up the google for fluid node/ maya network/ 3d gradient or something like that.

cheers.
 
Old 05-22-2013, 01:43 PM   #3
MrFrags
New Member
 
MrFrags's Avatar
portfolio
Mathias
London, United Kingdom
 
Join Date: May 2011
Posts: 10
Well, thanks Sorath for your answer.

As you mentioned, maybe isn't a good idea to think with x,y,z space because
I need something that works without location defined.

Also, the idea behind that stuff is to mimic an aera illuminated by some lights (as light is defined by a custom shape) in order to use a shader within this specific area.

I have two constraints: I can't use any UVs, and I can't use any light. This would mean that the system is interactive, at least at the render time.

I don't think a fluid based shapes solution is reliable. I did some search on google, and I didn't find any things useful. Thanks to an answer on Polycount, I've got maybe an idea ...

So the idea is to use the samplerInfo to obtain a sample point and closestPointOnMesh to obtain another one. Then, I need to find a way to compute the vector between the two points (samplerInfo point >>> closestPointOnMesh) and compute also the angle between the two vectors.

If this angle is greater than 90 degree, the point is inside the mesh. So it give me
my condition.

Here a schema



I'm not good at all when it comes to do computation, and nodes connection related to mathematical stuff .

I need your help !
 
Old 05-23-2013, 01:04 PM   #4
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
Unfortunately my company locked cgtalk for the artists, i'm on my phone now. I have a workingcopy of the file you need here, got it working with a fluid 3d texture, please send me your mailadress by pm and i send u the file, maybe you can upload it here afterwards. Cheers bastian
 
Old 05-23-2013, 01:10 PM   #5
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
nevermind, they just unlocked me

hope that is roughly what you've been looking for, I hooked the blend colors into the diffuse of the lamberts, of course then the occ is less visible.
But in basics, you can just hook it into a surface shader to use it as b/w mask in post.
Or directly hook shading/ textures or whatever into the blend color node.

ps, this is working in 3d space so x,y,z is supported!
Attached Images
File Type: jpg occFallofffLow.jpg (94.3 KB, 12 views)
Attached Files
File Type: zip fluidOccRadialDropoff.zip (10.6 KB, 3 views)
 
Old 05-23-2013, 01:55 PM   #6
MrFrags
New Member
 
MrFrags's Avatar
portfolio
Mathias
London, United Kingdom
 
Join Date: May 2011
Posts: 10
Thank you very much Sorath for taking the time to make me a file !
Your shader works well, but unfortunately it is not exactly the effect
I want to achieve. With your shader, I've got a falloff, and control over it,
that's great, but I can't use any shapes as actual volume, only the box
containing the volume shader. So, maybe it could help if I didn't find the solution,
but I hope we will find another one !

Here is another schema, maybe it could help.

Cheers Mathias

 
Old 05-24-2013, 08:31 AM   #7
MasonDoran
uhh...
portfolio
Mason Doran
Digital Artist
Freelance
Wien, Austria
 
Join Date: Jul 2002
Posts: 2,486
Send a message via ICQ to MasonDoran Send a message via Yahoo to MasonDoran
Hi Bastian!

Mathias, in the last example you could use a Mip_Rayswitch shader with a seperate shader assigned to the Refraction Rays,

But i suspect what you want is a Boolean shader, where you get a seperate shader where object interesect.

Boolean Shaders are found here:
http://www.puppet.su/download/shaders_p_e.shtml
__________________
: my website :
 
Old 05-24-2013, 09:31 AM   #8
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
hey Mason, hope everything is well in Vienna!

sorry Mathias, didn't read proberly.
I was also thinking of the shaderbool, but the rayswitch solution suggested by Mason sounds pretty awesome

edit: just saw neighter of those will give you a soft dropoff, idk. about the shaderbool maybe. So I tried with assigning the fluid to a custom polygon shape, unfortunately that emits fluids only outside on the faces, but the object itself is a hole.
Other then starting programming with c++ I can't think of anything.

In houdini you could just nodeconnect it, with ray depth/ray hit calc.
I'm not a shaderprogrammer, so I can't help you from here :/

Last edited by Sorath : 05-24-2013 at 09:53 AM.
 
Old 05-24-2013, 05:03 PM   #9
MrFrags
New Member
 
MrFrags's Avatar
portfolio
Mathias
London, United Kingdom
 
Join Date: May 2011
Posts: 10
Hi Mason and Bastian, thanks for your answers.

I tried both solutions, but unfortunately I can't achieve good results.
The first idea with mip shader was smart, but if I plug for example
an AO shader into the refraction slot of my "custom" mesh, then
the effect occurs only inside the mesh instead of the other meshes.

Also, I've got the "p" shader library and I know the boolean one, but you've
a big limitation: you just can use two meshes as input, so it doesn't work
in this case.

Here is a link that give me the second idea with the computation of angle, maybe it could help;
I really think it is possible to use the same logical approach by using sampled points instead of particles.

Cheers.
 
Old 05-25-2013, 04:01 PM   #10
MasonDoran
uhh...
portfolio
Mason Doran
Digital Artist
Freelance
Wien, Austria
 
Join Date: Jul 2002
Posts: 2,486
Send a message via ICQ to MasonDoran Send a message via Yahoo to MasonDoran
Combine the geometry, but do not delete the Combine node. Keep the history, leaving you control.

Also, for arguments sake, if you cannot get the effect inside the render engine, resort to old school hacks and do it in compositing. ie: render both versions, and a third render with the mask of the intersection.
__________________
: my website :

Last edited by MasonDoran : 05-25-2013 at 04:14 PM.
 
Old 05-27-2013, 04:56 AM   #11
VB2341
Frequenter
portfolio
Varun Bajaj
Troy, US
 
Join Date: Jan 2013
Posts: 125
If you're unable to get the soft dropoff with just the bool shader (which makes sense, as boolean variables only have two values), then you could use ambient occlusion to create an illusion of a falloff on the edge. The occlusion itself would then be used as a mask for blending from one shader into another. With the use of condition/multiply divide/layered/remap nodes, I don't think that should be too hard. I don't know what the bool shader is/how it works, but if it is able to define regions inside or outside of a mesh, I would think this should work.

If you're not sure what I'm saying, let me know. I might be able to help more if I knew more about the bool shader.
 
Old 05-27-2013, 02:16 PM   #12
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
I almost got it working here with a tripple shading switch and a ambient occlusion in an mib_continue inside a blend colors to have a soft dropoff driven by another ambient occlusion.
but without programming and maya which is the worst tool for shading this is just as always stuck at 90%.
Cause the thing creates occlusion behind the last wall aswell, so I need to put a mib_continue into the second ray hit.
Also nice to look into is the mib_glossy_refraction which gives you volume depht calculation.
maybe you can pipe something with these nodes and the bool.
Attached Images
File Type: jpg occ dropoff2.jpg (90.4 KB, 10 views)
 
Old 05-27-2013, 11:25 PM   #13
MrFrags
New Member
 
MrFrags's Avatar
portfolio
Mathias
London, United Kingdom
 
Join Date: May 2011
Posts: 10
Thanks a lot for your answers,

Sorath, I have to try your shader network, it sounds good. I will also try to follow
your idea with the mib_glossy_refraction.

I will post as soon as possible news and tests.

PS: Sorath, I tried to reproduce your shader network, but I don't have the same result as your.
Could you please send me the scene ?

Last edited by MrFrags : 05-28-2013 at 01:04 AM.
 
Old 05-28-2013, 07:50 AM   #14
Sorath
Expert
 
Sorath's Avatar
portfolio
Bastian Traunfellner
rays of light
Wien, Austria
 
Join Date: Jan 2005
Posts: 356
Hey Mathias,

try this, maybe you get it working.

cheers.
Bastian
Attached Files
File Type: zip objectControlledOcc_v2.zip (20.6 KB, 2 views)
 
Old 05-28-2013, 07:50 AM   #15
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:43 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.