Jump to content


reproduce Vray "invert normal" option for occlusion


  • Please log in to reply
11 replies to this topic

#1 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 07 August 2011 - 05:32 AM

Hello, I was wondering how could I reproduce the effect of the "invert normal" option in 3dsmax Vray dirt shader ?

like in this example :
http://www.spot3d.co...raydirt.htm#ex6

the only thing I could think of trying for now is invert N begore pluging it in occlusion vop, but it has no effect on my render.

Does anyone have a clue ?

#2 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 07 August 2011 - 06:14 AM

I think I have part of a solution
I inverted geometric normals this time ;) and it has an effect now.
it seems we have a problem where geometry is interpenetrating though. I haven't tried this configuration with Vray dirt yet, but I don't think I'll the same result.

But I like that already, it could give some nice details on the edges.

Attached Thumbnails

  • dirt_screenshot.JPG
  • dirt_test_01.JPG


#3 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 07 August 2011 - 09:42 AM

Hello again,
  I used the inverted occlusion to drive emission color of a standard Surface model Vop.
It gives a pretty good result. Sort of a SSS look, but cheaper I guess.( this image took 1 hour and a half, but I think the blurry reflection is responsible for a big part of the render time.)

Attached Thumbnails

  • dirt_test_02.JPG


#4 LaidlawFX

LaidlawFX

    Illusionist

  • Members
  • PipPipPip
  • 436 posts
  • Joined: 03-September 09
  • Location:Venice, CA
  • Name:Ben Laidlaw

Posted 07 August 2011 - 10:25 AM

A simple method would be to use a ramp parameter after your occlusion vop. This would let you get the outside edges and and even the inside edges, or what ever pattern you want.

I have done the same method you're speaking of in renderman, and this will cut out the extra geometry, or normal re-working.
Slash and hack!!! ...standing on the shoulders of giants isn't a good battle cry...

#5 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 07 August 2011 - 11:33 AM

good idea, I am definitly going to try to expand this shader into something a little more complicated.

By the way, correct me if I am wrong, but vex code seems much easier to read, passed a certain point of complexity,
would it be better for me to code that shader instead of building it with Vops ?

#6 LaidlawFX

LaidlawFX

    Illusionist

  • Members
  • PipPipPip
  • 436 posts
  • Joined: 03-September 09
  • Location:Venice, CA
  • Name:Ben Laidlaw

Posted 07 August 2011 - 05:18 PM

View PostMrGAG, on 07 August 2011 - 11:33 AM, said:

good idea, I am definitly going to try to expand this shader into something a little more complicated.

By the way, correct me if I am wrong, but vex code seems much easier to read, passed a certain point of complexity,
would it be better for me to code that shader instead of building it with Vops ?

Whatever manner gets the job done easier for you. Doing vops and vex are two great parallel structures, each having their pros and cons. I personally understand working in vops better when it comes to complex shading, or any nodal based shading system. Almost everyone that looks at my node based shader networks get confused, but looking at tons of vex code for me gets confusing.

On a completely personal belief, I think you will do a vops or vexs based work flowed depending on how you think. I am a very strong spatial learner. I've meet a few other people that do vops and they are of the same type of learning style. Where as many vex/coders are better with other skill sets.

If you haven't heard of what I am a talking about here is a quickly found article on it.
Theory of Multiple Intelligence

In the end it don't matter how you do it, as long as you get it done. So you're not wrong or right.
Slash and hack!!! ...standing on the shoulders of giants isn't a good battle cry...

#7 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 08 August 2011 - 05:26 AM

Quote

In the end it don't matter how you do it, as long as you get it done. So you're not wrong or right.

I can only agree that ;)
but I might be a bit on the other side to ...  I have a background in web scripting, max script, a little of python.
Don't really know why I didn't tried vex already. Maybe because it's so easy to use any function you want in vex, node base representation of function is a bliss. But on the other hand, I find that doing a simple "if / then " or a while loop become really tedious sometimes. ( especially regarding point clouds iterations .... ) I guess coding it would be easier for me sometimes.

#8 LaidlawFX

LaidlawFX

    Illusionist

  • Members
  • PipPipPip
  • 436 posts
  • Joined: 03-September 09
  • Location:Venice, CA
  • Name:Ben Laidlaw

Posted 08 August 2011 - 07:01 AM

View PostMrGAG, on 08 August 2011 - 05:26 AM, said:

I find that doing a simple "if / then " or a while loop become really tedious sometimes. ( especially regarding point clouds iterations .... )

lol... yeah, point clouds and while loops are still unsolved in my book, too... if/then blocks I finally got covered. Having practical applications to use the concepts makes them a lot easier.

-Ben
Slash and hack!!! ...standing on the shoulders of giants isn't a good battle cry...

#9 MrGAG

MrGAG

    Peon

  • Members
  • Pip
  • 69 posts
  • Joined: 14-April 08
  • Name:Guillaume Rouault

Posted 13 August 2011 - 04:39 AM

I am a bit confused :

I have a little vex script :

sop
sop_pc_test()
{

int handle = pcopen("op:/obj/pointCloud/OUT_pc","P",P,1,1);

vector myPos = pcfilter(handle,"P");
float dist = distance(P,myPos);
Cd = clamp(dist,0.0,0.1);

}

as you can see, this vex script runs in sop context. and it runs well.
When I try this in "surface" context, as a shader, it doesn't work at all. Of course I remembered to switch from "Cd" to "Cf", but besides that why wouldn't it work ?

surface
sop_pc_test()
{

int handle = pcopen("op:/obj/pointCloud/OUT_pc","P",P,1,1);

vector myPos = pcfilter(handle,"P");
float dist = distance(P,myPos);
Cf = clamp(dist,0.0,0.1);

}


#10 anim

anim

    Houdini Master

  • Members
  • PipPipPipPip
  • 983 posts
  • Joined: 23-August 07
  • Location:Slovakia, Bratislava
  • Name:Tomas Slancik

Posted 13 August 2011 - 05:31 AM

you cannot use "op:" to reference geometry in the shop context, since that path would be invalid when the shader is called
you need to reference geometry object on disk as your pointcloud texture
Tomas Slancik
Generalist
Slovakia

#11 symek

symek

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,544 posts
  • Joined: 02-November 04
  • Location:Waw/Pol
  • Name:Szymon Kapeniak

Posted 13 August 2011 - 09:22 AM

View Postanim, on 13 August 2011 - 05:31 AM, said:

you need to reference geometry object on disk as your pointcloud texture

... or create at run time for that matter.
(...) It was late, late in the evening, the lovers they were gone;
The clocks had ceased their chiming, and the deep river ran on.

#12 zhyravetsky

zhyravetsky

    Peon

  • Members
  • Pip
  • 17 posts
  • Joined: 03-August 11
  • Location:Ukraine
  • Name:Markiyan zhyravetsky

Posted 12 June 2012 - 04:23 PM

did yo model cristals in houdini and can you tel in which way im noob in modeling maby hip .?are they procedural..?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users