PDA

View Full Version : Write shaders in Maya or Mental Ray?


brianemsu2
07-04-2003, 06:44 PM
Ok, I'm very new to writing shaders... in that I haven't ever written one before. But I have an equation that I want to implement into a shader. Should I start to learn how to do it in Maya or in Mental Ray? I know that Mental Ray supports all of the Maya shaders, so would it better to just go ahead and learn how to do it in Maya... I may be totally off track already..
Any help would be appreciated since I want to use the shader for my projects.
-Brian

gga
07-07-2003, 12:31 AM
Originally posted by brianemsu2
Ok, I'm very new to writing shaders... in that I haven't ever written one before. But I have an equation that I want to implement into a shader. Should I start to learn how to do it in Maya or in Mental Ray? I know that Mental Ray supports all of the Maya shaders, so would it better to just go ahead and learn how to do it in Maya... I may be totally off track already..
Any help would be appreciated since I want to use the shader for my projects.
-Brian

As a learning exercise, it probably does not matter.

However, you will not be able to use a shader written for one renderer on the other renderer without rewritting most of it.

mental ray supports all the maya shaders simply because someone has taken the maya source code and made equivalent mentalray shaders, but not because they are interchangeable.

The math and algorithms used will end up being the same, thou.
Only the api of the renderer will be different. And once you are confortable with one api, switching to any other api is simple, relatively speaking. mental ray's api is slightly more powerful than maya's but that will only matter as you write a more complex shader.

From a gui perspective, mentalray custom shaders still do not integrate as seamlessly into maya as maya shaders do. And mental ray shaders will not work with maya's ipr.

maya's API uses C++ while mental ray's api uses C. If you have a language preference already, that may make your decision simpler.

If you have never coded in C, you should start learning that before jumping onto writing a shader, whether you code for mray, maya or even prman's shading language. You will need to be familiar with the basic syntax, and concepts such as what's a variable, a function, etc.

Besides the docs that come with maya, you can also learn quite a lot from the example source code provided in the maya distribution.

If you end up writting the shader for both renderers and give them the same ids and naming conventions, you should be able to switch back and forth between both renderers seamlessly.

clojster
07-07-2003, 05:12 PM
I'd like to ask if someone have some shaders (mental ray) to share. Or some site where can I download somes? :buttrock: :beer:

CGmonkey
07-07-2003, 07:39 PM
yEd - checkout http://www.3dluvr.com/pixho/ there are plenty of stuff :)

clojster
07-07-2003, 11:26 PM
Thanks CGMonkey, but there are only maya shaders... no mental ray ones. (as far as I'm not blind :) )

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