Layered shader viewport display?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  07 July 2011
Layered shader viewport display?

Hello all,

I have a chracter made of painted body parts (with transparency maps) mapped onto planes. I have all my lighting and shading painted in the textures and hence need to render the textures as is without any change done by the renderer. Hence, I am using surface shaders for my materials plugged into a layered shader (for correct transparency).

The problem is layered shaders display the texture at an extremely lores in the viewport makng it rather difficult to animate. Below you can see two images...the first is with lambert materials.It displays correctly, but dosen't render the textures exactly as they are. The second is using layered shaders. It renders correctly, but as you can see, is a mess in the viewport.

Of course, the first instinct is to increse display resolution of textures in the surface shader. But the moment you plug it into a layered shader, that option is greyed out.

Is there anyway I can get teh surface shader to display properly? Or is there any better approach to render stuff without being affected by lighting and shading?

Thanks for your time.
Attached Images
File Type: jpg 1.jpg (56.5 KB, 18 views)
File Type: jpg 2.jpg (39.2 KB, 18 views)
  07 July 2011
what you might consider doing is using a shader to work with for placement and UVs and then using a pre-Render MEL script to assign the layered shader or others that don't look right in hardware at the render time.

Prerender MEL example:
select -r pCube1; hyperShade -assign layeredShader1 pCubeShape1;

Postrender MEL example:

select -r pCube1; hyperShade -assign lambert2 pCubeShape1;

You can see this in action here:
  07 July 2011
Hi Dave,

Thanks for going thru that long post and a huge thanks for the solution. This just might be it!
I have a few questioons though. I was in fact decided on doing what teh script does manually if nothing else worked; i.e, finish all my shots with lamberts and replace each lambert with a layered shader (in each shot) manually during render.

From what I could undertsand, to use the script you mentioned, I need to write the pre render mel in the render globals during rendering. Now my chracters have like 20 planes each. So do I have to enter enter a code for each plane? If so, how is this better than assigning the shaders manually to each plane?

Thanks a lot.
  07 July 2011
Yes, I think you'll have to enter the code for each plane. It's better in the long run because then you'll never have to keep swapping out the textures manually after you do this once.
  07 July 2011
ya, it will be a long, ugly string of commands in the pre/post MEL slot but once it's done, it will be time saved
  07 July 2011
Thanks Dave(very nice blog there!) and Andrew.

Yes itd save time if you need to render, then feel like reworking on a shot, then rerender, etc.
But in my case when im done with the shot im done for good. Post thet, I need to save a version of the file with shaders replaced manually and render that version whenver i need to. So this ends up being the same amount of wrk, the only overhead being an extra file saved.

Or am I (Would be glad to) missing something?

  07 July 2011
It's simply because nobody ever takes their first render; something's always going to need fixing. If you're even going to render twice, the mel script saves time.

When I use this, I usually use it to hide geometry until render time. It seems like unnecesary hassle, but once you use it once, you realize how easy it makes your life.
  07 July 2011
Great. Does make sense. Thanks a lot
  07 July 2011
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

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
Society of Digital Artists

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

All times are GMT. The time now is 03:28 PM.

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