poygon sized pattern when using pbr

   3820   4   0
User Avatar
Member
13 posts
Joined:
Offline
This is odd. I am rendering with pbr using an imported .obj file and I am getting this polygon sized pattern (see pic)

it doesnt happen with polys generated in houdini, so I am pretty sure its not an issue with the shader, plus it is really simple:

hers my shader code:
{
F = .2;
F += ashikhmin( 1/urough, 1/vrough,normalize( dPds ) ,normalize( dPdt ));
}
tried faced sop, subdividing, consolidating points etc. primitive and point normals are fine and continous. rendering as subdi`s so normals are smoothed out.

any ideas?

Attachments:
checker.jpg (20.7 KB)

User Avatar
Member
941 posts
Joined: July 2005
Offline
Looks like dPds and dPdt are alternating.
Just use a shader to visualize those globals and see if you get a patchwork. If you do, then that's what's causing it (and would only show up when urough and vrough have different values).

Just in case, here's a simple shader to visualize them:

surface dP ( int wrt = 0; ) {
vector v = (wrt==0) ? dPds : dPdt;
Cf = normalize(v)*.5+.5;
}

P.S: using dPds and dPdt as the frame for anisotropy on polygons is generally not a good idea.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
13 posts
Joined:
Offline
Thanks Mario!

its exactly what you said.

however. looking for an alternative, I had a look in voplip.h
and all the anisothopic shading models use dPds and dPdt as input to the shading function by default.

I wonder if what else I can use? normalize(Du(?)), normalize(Dv(?))
thanks again

alex
User Avatar
Member
941 posts
Joined: July 2005
Offline
AlexStephan
however. looking for an alternative, I had a look in voplip.h
and all the anisothopic shading models use dPds and dPdt as input to the shading function by default.

Not just as default, but actually hard-wired… :roll:
For polygons, dPds and dPdt are not even guaranteed to be orthogonal (in fact, they are guaranteed to not be orthogonal for triangles) so, yeah, not a good choice.

AlexStephan
I wonder if what else I can use? normalize(Du(?)), normalize(Dv(?))

Any vector that lies on the tangent plane (the plane of the shading normal, not the geometric one) and that you pass as a parameter to your shader (you get the secondary one as a cross between it and the shading normal). The important thing is that it varies smoothly over the surface.
How you generate it is up to you: you could derive it from the shading normal and a reference vector, or paint/comb it by hand, or whatever.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
13 posts
Joined:
Offline
thanks mario.

I got it working, looks great!

now I am working on a glass shader that is not using matchvexspecular().
regards

alex
  • Quick Links