meerkat Posted February 19, 2006 Share Posted February 19, 2006 hello, i am having problems with displacements on polygons in renderman this is what i am getting: also here is the shader that i am using: displacement plast( float Km = 0.1; ) { vector NN = normalize(N); float mag = 0; float mag1 = 0; float y=10; normal Ndiff; point PP = transform("object",P); /*calculate mag*/ float i; float freq=1; for(i=0;i<3;i+=1) { mag+=(noise(PP*freq)-0.5)*2/freq; freq*=2.1; } mag /= length(vtransform("object",NN)); /*Displace*/ Ndiff = normalize(N) - normalize(Ng); P=P+mag*Km*NN; N=calculatenormal(P); } does anyone know how to fix this problem? thanks amir Link to comment Share on other sites More sharing options...
AdamJ Posted February 19, 2006 Share Posted February 19, 2006 You have to add back the 'normal' difference between your shading normals and your geometric normals back to your final N. N=normalize(calculatenormal(P)) + Ndiff Link to comment Share on other sites More sharing options...
meerkat Posted March 16, 2006 Author Share Posted March 16, 2006 I have another problem when displacing polygons have really hard normals like a cube, It seems to displace every face seperately. Is there any way around this without smoothing the normals? thanks in advance amir Link to comment Share on other sites More sharing options...
peliosis Posted March 17, 2006 Share Posted March 17, 2006 I have another problem when displacing polygons have really hard normals like a cube, It seems to displace every face seperately. Is there any way around this without smoothing the normals?thanks in advance amir 25693[/snapback] Yes because houdini makes edges hard by separating points. I'm not sure if that's renderman way of dealing with smoothness but it's a good problem to think of. I'm not sure how other software deals with it, perhaps they use vertex normals not point normals. One point can share several coincident vertices, but it has only one normal and therefore whatever the angle between faces is, they will always be smooth, because they have no separate normals. Cusping mean disconecting points and getting more normals to manage. Am I on my way? I don't know the solution to this problem though. Link to comment Share on other sites More sharing options...
stu Posted March 17, 2006 Share Posted March 17, 2006 It's possible to solve the cracking problem by using two sets of normals: displace using consolidated point normals (soft edges) and shade using unique point normals (hard edges). Link to comment Share on other sites More sharing options...
Mcronin Posted March 18, 2006 Share Posted March 18, 2006 Yes because houdini makes edges hard by separating points.I'm not sure if that's renderman way of dealing with smoothness but it's a good problem to think of. I'm not sure how other software deals with it, perhaps they use vertex normals not point normals. One point can share several coincident vertices, but it has only one normal and therefore whatever the angle between faces is, they will always be smooth, because they have no separate normals. Cusping mean disconecting points and getting more normals to manage. Am I on my way? I don't know the solution to this problem though. 25695[/snapback] You can use the crease SOP to add a creasewieght vertex attribute which will allow you to make hard edges in Renderman without splitting the surface. AFAIK creaseweight does not work with Mantra due to patent issues. The workaround in Houdini when dealing with subdivision surfaces, I guess, is to double up the geometry around edges you want to sharpen, which is what most modelers seem to do in other applications. If you render geometry as is in Houdini with displacements you will get your hard edges with subpixel displacement. Link to comment Share on other sites More sharing options...
Mcronin Posted March 18, 2006 Share Posted March 18, 2006 It's possible to solve the cracking problem by using two sets of normals: displace using consolidated point normals (soft edges) and shade using unique point normals (hard edges). 25704[/snapback] That's something that never occurred to me. I'm going to have to try it in Mantra. Link to comment Share on other sites More sharing options...
frodules Posted March 20, 2006 Share Posted March 20, 2006 I had the same problem with hard edged displacement in houdini and rendering "Polygons as Subdivision Surfaces" fixed it but seemed to screw up the uv's for the texture - strangely the displacement texture was still fine though? Also, all t coordinates seem to be inverted so that i'm having to flip texture images vertically so that they orient correctly - not sure whether this is affecting the coordinates when rendering as subdivs? and i'm getting these error messages in the shell N02003 Subdivmesh /obj/pip1/pip1 has duplicate edge connecting vertices 431 and 417.: Context "split gprim": Object "/obj/pip1/pip1" (WARNING) N02003 Subdivmesh /obj/pip1/pip1 has duplicate edge connecting vertices 417 and 423.: Context "split gprim": Object "/obj/pip1/pip1" (WARNING) N02003 Subdivmesh /obj/pip1/pip1 has duplicate edge connecting vertices 422 and 431.: Context "split gprim": Object "/obj/pip1/pip1" (WARNING) N02003 Subdivmesh /obj/pip1/pip1 has duplicate edge connecting vertices 423 and 422.: Context "split gprim": Object "/obj/pip1/pip1" (WARNING) N02011 Subdivmesh /obj/pip1/pip1 is a trivial mesh (created 0 patches).: Context "split gprim": Object "/obj/pip1/pip1" (WARNING) I tried adding a fuse sop to get rid of duplicate points but doesn't seem to make a difference seems strange as the texture on the shirt is coming out fine thanks Link to comment Share on other sites More sharing options...
frodules Posted March 20, 2006 Share Posted March 20, 2006 there were some duplicate points that the fuse sop wasn't getting rid of or edges or something - anyway - fixed now Link to comment Share on other sites More sharing options...
frodules Posted March 20, 2006 Share Posted March 20, 2006 would be quite interested to know about the flipped t-coordinate though Link to comment Share on other sites More sharing options...
Recommended Posts