Jump to content

How to make conditional shader assignment ?


sebkaine

Recommended Posts

Hi guys,

 

imagine that i have a car object in SOP. I would like to assign to this object 3 different shaders on it with a condition to select the good one.

 

if render engine = maxwell

         use mat_car_mxm SHOP

if render engine = mantra 

         use mat_car_mantra SHOP

if render engine = OpenGL viewport

         use mat_car_glsl SHOP

 

Is it possible to do so ? How would you proceed ?

Cause i am tired of making shader reasignment all the day ... :)

 

Many Thanks for your feedback !

 

Cheers 

 

E

Edited by sebkaine
Link to comment
Share on other sites

Ah, I thought you wanted it to be automatic :)

For the different renderers you could have different ROPs, and the Pre-Render Scripts could go and flip that main switch before render, and the Post-Render Script could flip it back to the OpenGL state..

Link to comment
Share on other sites

Ah, I thought you wanted it to be automatic :)

For the different renderers you could have different ROPs, and the Pre-Render Scripts could go and flip that main switch before render, and the Post-Render Script could flip it back to the OpenGL state..

 

I first though that it would be complex ... but it's really weird how houdini offer simple answer to what would have been PITA in maya while sometimes it require complex answer to very simple problem.

 

If you have a 100% auto way to solve this it would be fantastic !

 

You tricks with pre-render scripts is very clever thanks for this cause i wouldn't have think about this, would you do this in Python ? I really find the hscript synthax quite ugly , it remind me MEL ..  :)

 

Thanks again for your feedback eetu !

Edited by sebkaine
Link to comment
Share on other sites

Thanks for your answer Edward, :)

 

It looks very interesting as it seems to be exactly what SESI has build to do that.

But i must confess that i don't get exactly how it work, the help is not perfectly sharp, and i can't find exemple scene either.

 

How would you implement the select SHOP in my case ?

 

Cheers

 

E

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...