QUOTE(Chadrik @ 12/06/05, 09:00 AM)
does the code used to create the maya software shader double as the openGl shader?
[snapback]221627[/snapback]
NO, you can notice that teh shaders dont avctualy match,, they are infact two separate pieces of code that originate form the same node. So yes that means you need to do double the work, as woudld you if you wnated tahse shame shader ffor maya. Each peiece of shader in maya is prettymucjh written 3 to 4 times (once for maya sw, once for mr, once for hardware and sometimes once for hiquality render)
Write a hardware shader that mimics the look of your mr code and link it to your shape. Its descriped in the api manual, under the topic Writing a Hardware Shading Node
you will prbably find it easiet to wirte a aseparate node thzt just makes the shader then connect iit to the shadingroup and monitor shader assignements with scriptjobs. TOugh making one compound node is doaoable in maya 7 by relating a maya shader to the mr one (see whats new in maya 7 section of the manual)
Tough if your lazy you cold ujust use the hardware shader maya uses and override what it is in mentalray, it works for most objects as something like sss or skin because they couldnt well be done in hw anyway. For exqample dgs nodes counld be represented by phong shader since its the closest feedback youd get. BEst part of this method is that you dont need to use the api for it as its allready implemented in maya.