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?
poygon sized pattern when using pbr
3821 4 0- alexlstephan
- Member
- 13 posts
- Joined:
- Offline
- Mario Marengo
- 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.
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.
- alexlstephan
- Member
- 13 posts
- Joined:
- Offline
- Mario Marengo
- 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.
- alexlstephan
- Member
- 13 posts
- Joined:
- Offline
-
- Quick Links