Help - Search - Members - Calendar
Full Version: Plugin: Null Shader
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rendering, Compositing and Special Effects > Materials Laboratory > Shaders
ZPiDER
Following a request by Willi in this thread in the dev forum, i've created a null shader that will override any coloring the model gets from decals or materials or groups to white.

just set the "Null" shader for the Diffuse shader in a camera or a material. dont forget to activate plugin shaders on the camera!

OBSOLETE VERSION! SCROLL DOWN FOR NEW VERSION.
Willi
hi zpider,

that was quick, wow.
i tried it out on a sphere with diffuse color red and the null-shader apllied in the render settings. also on the camera and a material. the sphere is not complete white. here is a screenshot.

IPB Image
ZPiDER
hmm .. what a:m version is that? it always worked for me to override group colors, i've only noticed some slight residue from decals (look at the spaceship), i dont know where that might originate from ..
Willi
hi zpider,

it works!!!
the red sphere had a bit ambience. so the red color comes from the amience intensity. maybe it is possible to override also this (ambience intensity)?

greets
ZPiDER
you are right!
i could replicate your result when i took the 32patch sphere from the cd, but it worked alright with my own sphere.

why does this model have ambience intensity set?

anyway ..
i've updated the plugin, but i'm not resetting the ambiance intensity to 0, i'm overriding the ambiance color with white. that way you can still show an object brighter than others by adjusting the ambiance.

and here is the plugin for download:

OBSOLETE VERSION! SCROLL DOWN FOR NEW VERSION.
Willi
superb!!!
KenH
I wonder what application this has.....does Soulcage need to do a "white scene shot"? For demonstration purposes?
Nice coding Marcel!
ZPiDER
yes, i'd like to see an example of its production usage too!
maybe for compositing?
Rodney
Marcel,
At first glance I thought this might be the tool we might use to push objects into the Alpha Channel.
I see that my imagination got the best of me. Still very cool at any rate!

Could this modified so that A:M would see objects with the shader applied as a percentage of transparency?
I sure looks like this Null Shader comes close.

Thanks for the Null shader Marcel!

Edit: Rereading/Looking into this more I think my request doesn't fit the shader realm.
Not unless the shader recognized only specific materials and removed them from the scene.
Sorry for straying off topic.

Rodney
ZPiDER
Rodney,
i dont think i fully understand what you'd like .. it IS possible for A:M shaders to react to surface properties and also to CHANGE surface properties.
so for example i think i could code a shader that will render any object with a transparency below 20% as completely opaque, etc.
luckbat
QUOTE
I wonder what application this has.....does Soulcage need to do a "white scene shot"? For demonstration purposes?

Man, you guys must not do much compositing if you can't see the incredible power of Marcel's amazing plugin. I was trying to figure out a way to accomplish this effect almost a year ago. This plug-in is going to save me so much time and effort it's not even funny.

(By the way, is there any way to make a black null shader, too?)
ZPiDER
how would a black null shader work?
as black doesnt get any brighter by lighting it, all whats left would be the alpha (?)
luckbat
It's for rendering volumetrics as a separate pass. I often have characters walking through a beam of light. To separate out the volumetrics, I have to strip off all decals and delete all groups, make the set black and the characters black, render the sequence, then composite the volumetric render on top of the other rendered layers. So, a black null shader would be almost as useful to me as the white one.
ZPiDER
i've added a mode selector to the plugin. currently it supports the modes "white", "black" and "off",

"off" uses a very simple shading:
*dcol *= shading->GetLDot();

maybe more useful modes will crop up to be added later ..

download it and unzip to your shaders directory

THIS IS THE CURRENT VERSION
luckbat
Cool! Thank you so much, Marcel!
KenH
I just tried the 5.36kb version above and I get this error when opening AM:

Unable to find path>z-null.shd
The specified procedure could not be found.

v13c

Edit: It happens with the previous version (null shader) too.
ZPiDER
hmmm .. i guess it must be the a:m version .. can anyone else with the same version confirm this?
i'm compiling the plugin with the v12.0 sdk, because i'm still on 12 myself ..
jpappas
Hi Marcel,

I get the same error as Ken when opening AM, I'm using version 13.0b on WinXP.

-Jim
yoda64
QUOTE(ZPiDER @ Jul 14 2006, 05:35 PM) *

hmmm .. i guess it must be the a:m version .. can anyone else with the same version confirm this?
i'm compiling the plugin with the v12.0 sdk, because i'm still on 12 myself ..

There is a sdk difference in HShading
RGBFloat *GetDCol();
is in the V13 SDK defined as
RGBFloat GetDCol();




Willi
"I wonder what application this has.....does Soulcage need to do a "white scene shot"? For demonstration purposes?"

with this shader you can quickly edit the light setup in a complex scene, adjusting dome lighting, fills and key lighting. with all the color in, itīs sometime hard to say how much lighting a surface gets from a specific light.
also it can be used to have this lighting setup in a different pass...just by one click. otherwise you have to decolor all your models by hand.
ZPiDER
i'll compile a version for v13 as soon as i'm back from vacation (10 days). meanwhile you guys could brainstorm for additional shading modes wink.gif

Willi, thanks for the explanation!
luckbat
Any chance of a Mac-compatible version?
Rodney
QUOTE
Rodney,
i dont think i fully understand what you'd like .. it IS possible for A:M shaders to react to surface properties and also to CHANGE surface properties.
so for example i think i could code a shader that will render any object with a transparency below 20% as completely opaque, etc.


Marcel,
I think you've got the idea. I'm not being clear because I really don't fully understand whats happening behind the scenes. As I look into it I am learning more.

If you mean that the shader would render objects with a transparency below %20 as completely opaque *within the Alpha Channel* you are perfectly understanding me. The more I think about this though the more I think I'm overlooking. My focus here is entirely on manipulating the Alpha Channel.

You already understand far better than me the process of compositing.
Seeing your Null shader made me wonder how we might use it to control the transparency/Alpha channel to boost our productivity for compositing in layers within A:M.

As I understand it (short of the newly added Ambience adjustment) the Null shader strips color from the entire scene not individual objects. As you state some attribute (transparency would appear to be ideal) would have to tell the shader to remove an object from the image. This idea might be better served to be branched off into a new feature request where a new Attribute sets a 'layer number' that represented the image the shader would render to. The Shader then would only render those items on that layer. I'll stop here before I hurt myself...

I'll experiment with what your Null shader already does and leave the ideas of what it does not alone.
I'm not sure enough people would use the approach I'm talking about to justify the time it would take to create it. If I get enough of the idea together I'll launch it into A:M Reports.

Thanks for a great new tool!
John Bigboote
Hey, this looks GREAT! I can't wait to give it a twirl...so, currently it does not work with v13?

I can see it useful to have this white render as an alternate that will be mixxed in with a transfer mode in after-effects, to get that 'soulcage' look....riiight?

THANKS MARCEL!
ddustin
Marcel,
Is there any chance you will be able to make a V13 version now that you are back from vacation?

We could really use it.

Thanks,
David
Kamikaze
Thanks for the PI ......looks handy......

Mike
ZPiDER
i'll compile a version for 13 on monday, i'll also send it over to hash for a mac version. unless someone would like something to be added? this should be done BEFORE all the proting (edit: porting) work, it will be much more difficult later.
ddustin
QUOTE(ZPiDER @ Jul 30 2006, 02:19 AM) *

i'll compile a version for 13 on monday, i'll also send it over to hash for a mac version. unless someone would like something to be added? this should be done BEFORE all the proting work, it will be much more difficult later.


Marcel,
Thanks for looking at this for Version 13.

From what I read you should be able to use the shader to de-color models in either white or black.
All this without having to de-color models by hand.

What do you mean by "this should be done BEFORE all the proting work, it will be much more difficult later"?

Thanks again Marcel!!


David
Rodney
QUOTE
What do you mean by "this should be done BEFORE all the proting work, it will be much more difficult later"?


I think he meant to say 'PORTING', as in porting to the Mac.
ddustin
QUOTE(Rodney @ Jul 30 2006, 10:15 AM) *

QUOTE
What do you mean by "this should be done BEFORE all the proting work, it will be much more difficult later"?


I think he meant to say 'PORTING', as in porting to the Mac.



Rodney,
I replied before I had my coffee, it seems obvious now. laugh.gif

David
ZPiDER
alright, here is the version for v13.
if someone could please test it, since i dont have v13 yet (in 2 days i will though - yeah!)
ddustin
QUOTE(ZPiDER @ Jul 31 2006, 05:33 AM) *

alright, here is the version for v13.
if someone could please test it, since i dont have v13 yet (in 2 days i will though - yeah!)


Marcel,
It works in V13, thank you!

Is there a way to selectively apply the shader.

What I mean is say we have a scene with vehicles and trees, and want to composite the trees in but need the vehicles to block the trees as they travel past them. Can the null shader be used on the vehicles only?

Thanks for your help!

David
DeeJay
@zpider:
Jup, works fine for me. Thanks!

@David
Just drop the shader on the appropriate model and activate "Plugin Shaders -> On"

Cheers,
DJ
ddustin
Yes I did drop the shader on the model, but I was wondering:

Can I set my ground geometry to Black and a vehicle to White. then render it out?

I can't seem to get both colors at the same time, it is either all white or all black.

Thanks,
David
DeeJay
@zpider:
It only works with real lights, right? As soon you turn on AO all the colors/textures/materials are back.
ZPiDER
hmm .. interesting.
yes it it acutally only supposed to work on real lights, since a shader needs a "light source" point, light direction, etc. for rendering .. i'm unsure if shaders can work with AO at all ..
maybe Yves could shed some light on this issue.
ddustin
Marcel,
Is there a way to have a white and a black shader on at the same time?

Thanks,
David
Zaryin
Skin Shader work with AO on, but you do need a light to get the correct effect, otherwise it's unnoticable.

Thanks for the plug-in smile.gif.
John Bigboote
This shader is VERY cool, Marcel!

I have trouble sometimes getting it to work, there's a lot of boxes to click, it seems...but I see this being WAY useful in my future.

I too wonder what David asks...Can you have one object render white while another goes black?

This brings-up an idea for a shader I had a while ago... 'Excuse from Alpha' would allow an object in a scene to be excluded in the alpha channel...

Just an idea for your 'genius' mind to tonker over.

THANX!
ddustin
QUOTE(John Bigboote @ Aug 3 2006, 01:40 PM) *

This shader is VERY cool, Marcel!

I have trouble sometimes getting it to work, there's a lot of boxes to click, it seems...but I see this being WAY useful in my future.

I too wonder what David asks...Can you have one object render white while another goes black?

This brings-up an idea for a shader I had a while ago... 'Excuse from Alpha' would allow an object in a scene to be excluded in the alpha channel...

Just an idea for your 'genius' mind to tonker over.

THANX!


Matt,
Do you mean show the object in all black, when you mean excuse from alpha?

David
ZPiDER
dustin, no, he means that the object will not affect the alpha channel of the resulting image.

matt, i think what you'd like is not possible. it would be very easy to hide an object from the alpha by just making it transparent, but i guess you'd still want it to render ..

zaryin, thanks for the heads-up on the skin shader! as soon as yves is back, i'll ask him about it.
ddustin
QUOTE(ZPiDER @ Aug 4 2006, 01:12 AM) *

dustin, no, he means that the object will not affect the alpha channel of the resulting image.

matt, i think what you'd like is not possible. it would be very easy to hide an object from the alpha by just making it transparent, but i guess you'd still want it to render ..

zaryin, thanks for the heads-up on the skin shader! as soon as yves is back, i'll ask him about it.


Marcel,
So here is my oringinal question.
Can we use the null shader plugin to have some objects white and some objects black?

It seems it is either all white or all black.

Thanks,
David
DeeJay
Just create two materials, one with Null-shader set to black, the other set to white. Use this materials to shade the objects you need. Works fine for me (character black shader, paper white shader):

ZPiDER
dustin,
yes, this was the intention.
if some objects would need to be white and some black, you'd need an interface to tell the plugin which ones are white. so i would recommend using materials if you are aiming for that, since its very easy to assign a material to an object.
what application would this have?
ddustin
QUOTE(ZPiDER @ Aug 4 2006, 05:15 AM) *

dustin,
yes, this was the intention.
if some objects would need to be white and some black, you'd need an interface to tell the plugin which ones are white. so i would recommend using materials if you are aiming for that, since its very easy to assign a material to an object.
what application would this have?


Marcel,
We will use it to render out different aspects of the scene with alpha channels on, then composite things in later.

I was not using it as a material, just selecting the null shader in the model properties.
What if you have other materials on the model already? Will the null shader material take precedence over the other materials?

Thanks,
David
John Bigboote
Zpider- You asked for a sample of your shader used in a production environment...here you go! I just finished my 1987 International Boxtruck project for Emelio Liscio who gives permission to share this image. Your shader makes it easy to render the 'Doughboy' look...in fact, 'Doughboy' would be a good name for it...if only 'null shader' wasn't so appropo.

Average render times for these images...
Reflective pass: 1:30
Null Pass: :30
Flat Pass: :15

I then did a 'quick' composite of these animated passes in After Effects using various transfer modes and adding a little grain...here's a link to the animation:
http://www.youtube.com/watch?v=2y7wfWiELZc

THANKS Spider!
Eric2575
Thank you Marcel for another great plugin!
Zaryin
QUOTE(ZPiDER @ Aug 4 2006, 03:12 AM) *

zaryin, thanks for the heads-up on the skin shader! as soon as yves is back, i'll ask him about it.


Here's a link to a pic I made of a character with the skin shader applied. AO was used in this pic also.

http://www.hash.com/forums/index.php?act=A...st&id=17777

John Bigboote
QUOTE(ZPiDER @ Jul 14 2006, 01:34 AM) *

Following a request by Willi in this
just set the "Null" shader for the Diffuse shader in a camera or a material. dont forget to activate plugin shaders on the camera!


This is gonna sound silly. I know I posted an example (truck, above) using this shader...wull, now I can't remember how to get it to work. Can anyone eshplain the step by steps?

For SOME reason, I am seeing two null shaders in my list... one named null, and one named null shader.

It's supposed to be as easy as activating the shader on the cameras 'plugin shaders' and then turning on 'apply camera's post effects'...right?

Do I have to do something to every model? Lights?

It worked fine before, now I can't get it to go.

EDIT: I GOT IT TO GO...YOU LOOK FOR THE SHADER THAT LETS YOU SPECIFY BLACK OR WHITE...THATS THE ONE YOU WANT. AND I GUESS NOTHING WAS HAPPENING UNTIL YOU SPECIFY A COLOR...AS THE DEFAULT WHITE STILL NEEDS TO BE SET. OTHER THAN THAT...WORKS A CHARM!
HomeSlice
I just noticed this topic. Sorry for the late post. This is a great addition Marcel. Thanks! I was looking for something similar to this a few days ago, but a little different. I had 12 bas relief sculptures that were fully textured. Then I had to render out normal maps of each one. I did it by copying each model, deleting all decals and materials, then applying Aaver's Normal Map material. It worked, but I REALLY wanted a solution where I didn't have to delete all the materials and decals.

Is there any way to get this shader to work for easily making normal maps?

Thanks again!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.