disable specular lighting on per obj or shader basis?

   4325   5   1
User Avatar
Member
47 posts
Joined: 3月 2010
Offline
I like to disable specular component from a light base on per object or shader without separate lighting setup. Is it possible to set this up on per object basis?

Does something like light selection(mask) exists on Physically Based Specular VOP or Diffuse VOP shading component inside shader??

Thank you
Edited by - 2014年9月29日 16:52:11
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
Yes , even you can use different Specular color for different objects with same shader !

Just add a custom attribute for your objects , then import this attribute in your shader and multiply it with final specular ! 8)
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
I made a simple project about this for you :wink:

Attachments:
JKSpec.zip (101.9 KB)

https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
47 posts
Joined: 3月 2010
Offline
thank you Joker, overwriting spec geometry attribute will not filter per lighting component, sorry I didn't make it clear. ops:

There are few lights illuminate the same object. I like to switch off specular but still receive diffuse contribution from one of those lights, and other lights illuminate as normal. I used to setup extra light only for this object with specular lighting off, but it's messy when scene gets complex. Wonder if there is something on object or geometry level that combine “light mask” on object node and “light contributions” on light node does per light contribution component filtering.

For shader, I just found ‘lightmask’ does per shading component support.
http://www.sidefx.com/docs/houdini13.0/vex/contexts/shading_contexts#lightmask [sidefx.com]

I setup a sphere scene with 2 lights(light1, light2) and following code on inlineVop connect to surfaceOutputVOP of a material shader builder.

vector nn=normalize(N);
$f = diffuse(nn, .5, “lightmask”, “light1”) * 2;


Both light illuminate as without “lightmask”, I couldn't get it work.
User Avatar
Member
1391 posts
Joined: 12月 2010
Offline
I used to setup extra light only for this object with specular lighting off


Did you try "Non Specular Light" option in the Light node !?
Of course you should add this in the Edit Parameter interface .
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
47 posts
Joined: 3月 2010
Offline
yes, that's what I did before H13. H13 new lighting contribution works like a charm

any idea how the ‘lightmask’ label works??

anyway, thank you for your help
  • Quick Links