Jump to content

How to use Normal Maps to fake displacement in Houdini


Recommended Posts

Hello Everyone,

I have seen Normals maps getting used in Max or Maya (specially in games) used over low poly geometry to fake the displacement effects.

How can this be doing in Houdini?let's say if I generate my Normal map from ZBRUSH.

Many Thanks.

Zasid

Link to comment
Share on other sites

Hello Steven,

I know how to render a normal map in HOudini,but I dont know how to do the same just as I mentioned

"I have seen Normals maps getting used in Max or Maya (specially in games) used over low poly geometry to fake the displacement effects.

How can this be doing in Houdini?let's say if I generate my Normal map from ZBRUSH."

so I search the forum but didn't get anything on it .

I have also read the ODWIKIN ZB to HOUDINI documents.

but can't figure out a way how to fake displacment in HOudini thro Normal maping method so please address this issue if u know many thanks.

Link to comment
Share on other sites

H9.5 Beta in SHOPs: Tab > OGL2 > "OGL2 Object Normal Map" or "OGL2 Tangent Normal Map". The latter requires tangent space attributes as generated by the PolyFrame SOP. Both require correct normal maps. There's many variations of normals mapps though so YMMV.

Link to comment
Share on other sites

Hello Steven,

I know how to render a normal map in HOudini,but I dont know how to do the same just as I mentioned

"I have seen Normals maps getting used in Max or Maya (specially in games) used over low poly geometry to fake the displacement effects.

How can this be doing in Houdini?let's say if I generate my Normal map from ZBRUSH."

so I search the forum but didn't get anything on it .

I have also read the ODWIKIN ZB to HOUDINI documents.

but can't figure out a way how to fake displacment in HOudini thro Normal maping method so please address this issue if u know many thanks.

Sorry, I misunderstood what you wanted. I thought you wanted to render displacement but you would like to use them for display.

Do what Edward says and let us know how it goes. :)

Cheers!

steven

Link to comment
Share on other sites

Is there also a VEX Tangent Normal Map for Mantra?

No, but it shouldn't be too hard to translate it from GLSL. Right-click on the SHOP > Type Properties > Code. The fragment shader should be understandable (I hope).

Link to comment
Share on other sites

No, but it shouldn't be too hard to translate it from GLSL. Right-click on the SHOP > Type Properties > Code. The fragment shader should be understandable (I hope).

This sounds like a good candidate for SESI to add to the distribution, no?

Link to comment
Share on other sites

shouldn't be too hard to translate it from GLSL.

I currently don't have access to 9.5 - I was assuming that this might be possible.

It's probably just copy&paste.

This sounds like a good candidate for SESI to add to the distribution, no?

I second that.

Link to comment
Share on other sites

I currently don't have access to 9.5 - I was assuming that this might be possible.

It's probably just copy&paste.

I second that.

I could be terrible wrong here, but it seems that using Tangent Space Normal Maps in Mantra is just a matter of bellow code.

(according to this paper)

GLSL is a different beast because I think it deals with light directions instead of modifying normals...

#pragma hint uv hidden
surface
tangentNormals(string tangents = "";
			   vector uv	   = 0; )
 {
	 vector tN = 2 *  texture(tangents, uv.x, uv.y) - 1;
	 N = normalize(normalize(dPds) * tN.x + normalize(dPdt) * tN.y + N * tN.z);

	 // and farther lighting models as desired:
	 Cf = diffuse(N) * 0.8;
 }

Seems to work in my simple test.

Edited by SYmek
Link to comment
Share on other sites

  • 2 weeks later...

Im still trying to get object-space normals from zbrush to work in mantra. It doesn't work...

I sample the texture, fit to range -1-1, and negate the Y component. Connecting this into the nN parameter of the Lighting Model VOP gives correct results from only certain viewing angles, which is strange since there is nothing view dependent in the code. When looking at the normals as colors, everything looks good except the Z-axis, which looks like it should be reversed also, but doing so only gets things worse.

I tried transforming the normals from object space to camera space or current space, and several other combinations, but none works. I don't know what else to try.

Maybe someone has an example hip for this?

Link to comment
Share on other sites

Im still trying to get object-space normals from zbrush to work in mantra. It doesn't work...

I sample the texture, fit to range -1-1, and negate the Y component. Connecting this into the nN parameter of the Lighting Model VOP gives correct results from only certain viewing angles, which is strange since there is nothing view dependent in the code. When looking at the normals as colors, everything looks good except the Z-axis, which looks like it should be reversed also, but doing so only gets things worse.

I tried transforming the normals from object space to camera space or current space, and several other combinations, but none works. I don't know what else to try.

Maybe someone has an example hip for this?

Could you attach some dummy object with normal map from ZBrush so we could try on it?

Edited by SYmek
Link to comment
Share on other sites

In what space should the normals be supplied to mantra/to the Lighting model VOP?

Hi ofer,

sorry I don't have too much time now. Maybe later today I'll try your maps - this bothers me also.

As to your question: lighting models assumes current space which is camera space.

Link to comment
Share on other sites

Woohoo, I've got object-space normal maps working. The problem was I had to negate both Y and Z directions, and transform from object to camera space. It took me sometime to understand it, because I didn't try it all at once.

Now I need to get tangent space normal maps to work. I tried the code snippet from this thread, but normalized dpds/dpdt looks very chunky. Maybe Im doing something wrong, and I need to try again after I learned a few things.

Thanks for the help.

Link to comment
Share on other sites

Woohoo, I've got object-space normal maps working. The problem was I had to negate both Y and Z directions, and transform from object to camera space. It took me sometime to understand it, because I didn't try it all at once.

Now I need to get tangent space normal maps to work. I tried the code snippet from this thread, but normalized dpds/dpdt looks very chunky. Maybe Im doing something wrong, and I need to try again after I learned a few things.

Thanks for the help.

Great news. As to the snippet, it never was tested properly. I simply opened mentioned paper and check it on grid with brushed dots from nvidia normal maps generator. It looked ok, but as I said nothing more I can say about it. Indeed the dpds/dpdt part is most subspecies. You could use tangent space vactors from SOPs and test it, but I'm not sure about anything here. Actually I hoped that after posting that snippet someone smarter will fix it ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...